View Issue Details

IDProjectCategoryView StatusLast Update
0015949LazarusWidgetsetpublic2010-03-11 11:57
ReporterBart BroersmaAssigned ToLuiz Americo 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSSuse LinuxOS Version10.0
Product Version0.9.29 (SVN)Product Buildr23919 
Target Version0.9.30Fixed in Version0.9.30 
Summary0015949: TButton invisible when 'GtkButton' does not support property named 'inner-border'
DescriptionOn older gtk2 versions, that do not support property named 'inner-border' for GtkButton, all TButtons are invisible, both in IDE and in compiled program.

Tested on Suse 10.0 with gtk2 version gtk2-2.8.3-4
 
Additional Informationin /lcl/interfaces/gtk2/gtk2wsstdctrls.pp

procedure Gtk2WSButton_SizeAllocate(widget: PGtkWidget; allocation: PGtkAllocation; user_data: gpointer); cdecl;


    width := width + 2 * xthickness;
    gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
    if inner_border <> nil then
    begin
       x := x - inner_border^.left;
       width := width + inner_border^.left + inner_border^.right;

This (if inner_border <> nil) will always evaluate to true, because the local variable inner_border is not initialized to nil


Changing it to

    width := width + 2 * xthickness;
    inner_border := nil;
    gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
    if inner_border <> nil then
    begin
       x := x - inner_border^.left;
       width := width + inner_border^.left + inner_border^.right;

Will solve the issue (for me at least).

I attached a diff for it.
TagsNo tags attached.
Fixed in Revision23925
LazTarget0.9.30
WidgetsetGTK 2
Attached Files
  • gtk2.tbutton.sizeallocate.diff (504 bytes)
    Index: gtk2wsstdctrls.pp
    ===================================================================
    --- gtk2wsstdctrls.pp	(revision 23919)
    +++ gtk2wsstdctrls.pp	(working copy)
    @@ -1903,6 +1903,7 @@
         height := height + 2 * ythickness;
         x := x - xthickness;
         width := width + 2 * xthickness;
    +    inner_border := nil;  //initialize this to nil before the call to gtk_widget_style_get!
         gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
         if inner_border <> nil then
         begin
    

Activities

2010-03-10 17:38

 

gtk2.tbutton.sizeallocate.diff (504 bytes)
Index: gtk2wsstdctrls.pp
===================================================================
--- gtk2wsstdctrls.pp	(revision 23919)
+++ gtk2wsstdctrls.pp	(working copy)
@@ -1903,6 +1903,7 @@
     height := height + 2 * ythickness;
     x := x - xthickness;
     width := width + 2 * xthickness;
+    inner_border := nil;  //initialize this to nil before the call to gtk_widget_style_get!
     gtk_widget_style_get (widget, 'inner-border', @inner_border, nil);
     if inner_border <> nil then
     begin

Bart Broersma

2010-03-10 17:42

developer   ~0035190

Luiz, I assigned this issue to you, since you wrote this code for r23028?

Luiz Americo

2010-03-10 18:12

developer   ~0035192

I was just asking you to test adding inner_border := nil; ;)
Close if OK

Bart Broersma

2010-03-11 11:57

developer   ~0035241

Fixed. Thanks.

Issue History

Date Modified Username Field Change
2010-03-10 17:37 Bart Broersma New Issue
2010-03-10 17:37 Bart Broersma LazTarget => -
2010-03-10 17:37 Bart Broersma Widgetset => GTK 2
2010-03-10 17:38 Bart Broersma File Added: gtk2.tbutton.sizeallocate.diff
2010-03-10 17:40 Bart Broersma Status new => assigned
2010-03-10 17:40 Bart Broersma Assigned To => Luiz Americo
2010-03-10 17:42 Bart Broersma Note Added: 0035190
2010-03-10 18:12 Luiz Americo Fixed in Revision => 23925
2010-03-10 18:12 Luiz Americo LazTarget - => 0.9.30
2010-03-10 18:12 Luiz Americo Status assigned => resolved
2010-03-10 18:12 Luiz Americo Fixed in Version => 0.9.30
2010-03-10 18:12 Luiz Americo Resolution open => fixed
2010-03-10 18:12 Luiz Americo Note Added: 0035192
2010-03-10 18:12 Luiz Americo Target Version => 0.9.30
2010-03-11 11:57 Bart Broersma Status resolved => closed
2010-03-11 11:57 Bart Broersma Note Added: 0035241