In terms of adding functionality to the widget itself to handle this  
very contentious situation, whynot something like:

1) add an attribute to the widget named, say,  
GTK_LABEL_NO_SIZE_REDUCTION (or whatever)
2) with this attribute set, the label will only resize if the new  
label results in a size larger than the currently known maximum,  
i.e., the maximum size of all previously set labels for any given  
invocation of the program.

It would seem to me this would be fairly straightforward to  
implement, only need to save the current max size and test against it  
when the label is re-set.

Not sure, but I would bet this would solve the original poster's  
problem (while the required change to the widget would, as well, not  
be so onerous?).

richard

On Mar 30, 2007, at 1:34 PM, [EMAIL PROTECTED] wrote:

> On 3/30/07, Paul Davis <[EMAIL PROTECTED]> wrote:
>> So I've spent about 15 minutes going through software on this  
>> computer
>> looking through different windows trying to find an example of a  
>> label
>> that changes to convey some interesting piece of information. I can't
>> find any.
>
> I don't know if this is what you mean, but I have an example in my
> image processing application.
>
> Image windows have an optional status bar which shows width, height,
> etc. and also current mouse position in x/y image coordinates, and the
> value of the pixel under the mouse.
>
>   http://cima.ng-london.org.uk/~john/statusbar.png
>
> The labels showing x/y/value have to be fixed in size so they don't
> jiggle left-right as you move the mouse around. I do this by calling
> gtk_widget_set_size_request() on them after measuring the size of the
> largest value I can show in the right font.
>
> It seems that calling gtk_widget_set_size_request() on a label locks
> the size, but doesn't stop the label from triggering a resize when the
> label's content next changes.
>
> Maybe this is somthing that could be changed without breaking  
> anything?
>
> John
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>

_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to