[Gambas-user] GridEditor

Benoît Minisini gambas at ...1...
Tue Jun 23 18:17:18 CEST 2009


> > Attached is the code that will cause the Sig11.
> >
> > This is the error I'm seeing:
> >
> > (testGridEditor:14683): Gtk-WARNING **: gtk_widget_size_allocate():
> > attempt to allocate widget with width -3 and height -3
> >
> > (testGridEditor:14683): Gtk-CRITICAL **: gtk_entry_set_text: assertion
> > `text != NULL' failed
> >
> >
> > To reproduce:
> >
> > Double-click a field in the Legs column to edit. Change the value to be
> > empty. Double-click the next field in the Legs column to edit. That
> > should raise the Signal 11.
> >
> > Take care,
> > -jason
>
> For specific GridEditor problems, you must see with Gareth Bult, its
> author. I will install it just to debug the crash.
>
> Regards,

GridEditor resizes itself when it wants, which is a bad implementation idea as 
sometimes the ClientW and ClientH property of Container classes (especially 
TabStrip) is not accurate in some components which delay the layouting of 
their widgets.

So to have a correct behaviour, you have to tell him to resize at the right 
moment, which is in the Arrange evenement of its container. Hopefully the 
internal magic routine that resizes the GridEditor is public, and its name is 
Resize. Which is a bad idea too, as it overrides the public Resize() method of 
the Control class.

So:

PUBLIC SUB tabs_Arrange()

  grid.Resize

END

And you will see things as expected.

As for the crash, I have fixed the bug in revision #2039.

Regards,

-- 
Benoît




More information about the User mailing list