[Gtk2] autosize question

Henry Vermaak henry.vermaak at gmail.com
Tue Dec 8 22:33:36 CET 2009


2009/12/8 Mattias Gaertner <nc-gaertnma at netcologne.de>:
> On Tue, 8 Dec 2009 17:15:22 +0000
> Henry Vermaak <henry.vermaak at gmail.com> wrote:
>
>> Hi gtk2 list
>>
>> I realised today that the lcl doesn't react very well if you change
>> the size of the system font.  Autosized controls should react by
>> invalidating and re-computing their size.  I thought the best place to
>> do this is GTKStyleChanged (using the style-set signal).  It should be
>> really simple, like calling InvalidatePreferredSize or something, but
>> I can't get it to work (except if I call
>> gtk_widget_set_size_request(widget, -1, -1), but I doubt if that's the
>> best thing to do).  Can someone give me any hints, please?
>
> AControl.InvalidateClientRectCache(false);
>
> Then send a WMSize message to the control.

Hmm, this works, but the resize seems to be one event behind.  So the
first resize does nothing, then the next one resizes to where the
previous one should have been.  I used ConnectSenderSignalAfter, but
that didn't help.

Also, the labels don't obey the system font resize at all, any reason for that?

Henry




More information about the Gtk2 mailing list