Re: GTK Table resizing...



If you call gtk_widget_set_usize() on the label, you can keep it from
requesting more size than the usize. That might work.

Havoc

This could work.  However, I'd like to not use widget_set_usize() only
because if someone had a different font size, it would not be right.  Is
there some way I could get the size of the cell before I put the label
into it, and then use gtk_widget_set_usize() with that number??  That
would be good if I could do that somehow.  Thanks.

width  = widget->allocation.width;
height = widget->allocation.height;

These functions should give you the size of any widget,
I think, as long as (I suppose this is right but you
need to check, I might be wrong):

- the widget has an X-window (labels have no X window);
- the widget is realized;

In practise, you could consider inserting say, an event box 
inside the table cell, and the label inside the event box, 
show everything and after the table is actually visible,
determine the size of the event box, put the string in the 
label after, then apply widget_set_usize on the event 
box itself and finally redraw everything. I did not test
this, but if it works it will work so quickly that the
user will never see the initial blank label.

You might find better solutions though.

Carlos




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