mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 15:18:16 +02:00
fix NIL style crash and GTK2 Compiling
git-svn-id: trunk@4904 -
This commit is contained in:
parent
8e856f0847
commit
6879fd5729
@ -4603,7 +4603,7 @@ begin
|
|||||||
If Not Assigned(Styles) then
|
If Not Assigned(Styles) then
|
||||||
exit;
|
exit;
|
||||||
l:=IndexOfStyle(WName);
|
l:=IndexOfStyle(WName);
|
||||||
//writeln('GetStyle A ',WName,' ',l);
|
// writeln('GetStyle A ',WName,' ',l);
|
||||||
If l < 0 then begin
|
If l < 0 then begin
|
||||||
// create a new style object
|
// create a new style object
|
||||||
StyleObject := NewStyleObject;
|
StyleObject := NewStyleObject;
|
||||||
@ -4651,7 +4651,7 @@ begin
|
|||||||
StyleObject^.Widget := nil;
|
StyleObject^.Widget := nil;
|
||||||
GTK_Tooltips_Force_Window(TP);
|
GTK_Tooltips_Force_Window(TP);
|
||||||
gtk_widget_ensure_style(PGTKTooltips(TP)^.Tip_Window);
|
gtk_widget_ensure_style(PGTKTooltips(TP)^.Tip_Window);
|
||||||
StyleObject^.Style:=GTK_RC_GET_STYLE(PGTKTooltips(TP)^.Tip_Window);
|
StyleObject^.Style:=gtk_widget_get_style(PGTKTooltips(TP)^.Tip_Window);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
If AnsiCompareText(WName,'gtk_default')=0 then begin
|
If AnsiCompareText(WName,'gtk_default')=0 then begin
|
||||||
@ -4665,7 +4665,7 @@ begin
|
|||||||
// ensure style of the widget
|
// ensure style of the widget
|
||||||
If (StyleObject^.Widget <> nil) then begin
|
If (StyleObject^.Widget <> nil) then begin
|
||||||
gtk_widget_ensure_style(StyleObject^.Widget);
|
gtk_widget_ensure_style(StyleObject^.Widget);
|
||||||
StyleObject^.Style:=GTK_RC_GET_STYLE(StyleObject^.Widget);
|
StyleObject^.Style:=gtk_widget_get_style(StyleObject^.Widget);
|
||||||
// ToDo: find out, why sometimes the style is not initialized.
|
// ToDo: find out, why sometimes the style is not initialized.
|
||||||
// for example: why the following occurs:
|
// for example: why the following occurs:
|
||||||
If AnsiCompareText(WName,'button')=0 then begin
|
If AnsiCompareText(WName,'button')=0 then begin
|
||||||
@ -5004,10 +5004,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
ThemeWidget:=GetWidgetWithBackgroundWindow(ThemeWidget);
|
ThemeWidget:=GetWidgetWithBackgroundWindow(ThemeWidget);
|
||||||
if ThemeWidget<>nil then begin
|
if ThemeWidget<>nil then begin
|
||||||
if GtkWidgetIsA(ThemeWidget,GTK_LIST_ITEM_TYPE) then
|
if GtkWidgetIsA(ThemeWidget,GTK_TYPE_LIST_ITEM) then
|
||||||
Style:=GetStyle('list');
|
Style:=GetStyle('list');
|
||||||
if Style=nil then
|
if Style=nil then
|
||||||
Style:=PGtkStyle(ThemeWidget^.thestyle);
|
Style:=PGtkStyle(gtk_widget_get_style(ThemeWidget));
|
||||||
end;
|
end;
|
||||||
if Style=nil then
|
if Style=nil then
|
||||||
Style := GetStyle('default');
|
Style := GetStyle('default');
|
||||||
@ -5620,6 +5620,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.233 2003/12/18 15:15:13 ajgenius
|
||||||
|
fix NIL style crash and GTK2 Compiling
|
||||||
|
|
||||||
Revision 1.232 2003/11/30 18:35:20 mattias
|
Revision 1.232 2003/11/30 18:35:20 mattias
|
||||||
fixed fpc 1.9.1 warns
|
fixed fpc 1.9.1 warns
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ uses
|
|||||||
function GTK_TYPE_SCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_scrollbar_get_type';
|
function GTK_TYPE_SCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_scrollbar_get_type';
|
||||||
function GTK_TYPE_HSCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_hscrollbar_get_type';
|
function GTK_TYPE_HSCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_hscrollbar_get_type';
|
||||||
function GTK_TYPE_VSCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_vscrollbar_get_type';
|
function GTK_TYPE_VSCROLLBAR : TGTKType; cdecl; external gtkdll name 'gtk_vscrollbar_get_type';
|
||||||
|
function GTK_TYPE_LIST_ITEM : TGTKType; cdecl; external gtkdll name 'gtk_list_item_get_type';
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
procedure laz_gdk_gc_set_dashes(gc:PGdkGC; dash_offset:gint;
|
procedure laz_gdk_gc_set_dashes(gc:PGdkGC; dash_offset:gint;
|
||||||
|
Loading…
Reference in New Issue
Block a user