[Gtk2] autosize question
Mattias Gaertner
nc-gaertnma at netcologne.de
Tue Dec 8 22:46:38 CET 2009
On Tue, 8 Dec 2009 21:33:36 +0000
Henry Vermaak <henry.vermaak at gmail.com> wrote:
> 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.
I don't know. Maybe you can create an example.
> Also, the labels don't obey the system font resize at all, any reason for that?
Probably the font handles must be recreated.
Mattias
More information about the Gtk2
mailing list