Re: [gtk-list] Re: gtk_label_set_text and gtk_widget_queue_resize

>I don't understand how you'd avoid a size request on set_text() -
>after all, the label's size request depends on the text the label
>contains, doesn't it?

absolutely, but as we both know, it almost never honored. if resetting
the text generally led to a resize, then it would make sense. however,
i have never seen a GTK application display this behaviour, and its
not entirely clear that it would be desirable.  If you are using a
label as just as placeholder for some text, the strategy is presumably
to make sure that the usize for the label is big enough to hold the
biggest possible string, and then just change the text that is
displayed when necessary. if the widget/container heirarchy actually
implemented size changes every time the text was changed, you'd have
to explicitly put it calls to prevent this from happening or face a
very bizarre UI, no ?

>Re: setting the usize based on style->font, just call
>gtk_widget_ensure_style() to ensure you have a style, then set the

Ah, perfect ... thanks.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]