Re: [gtk-list] more widget size problems/questions



On Sun, 20 Jun 1999, brent verner wrote:

> i need help again. i'm having a helluva time getting the
> size of widgets... could anyone offer reason why the following
> code does not give me the actual dimension of the helpfind
> widget? the call to gtk_widget_size_request() tells me
> this widget is 12x12. 

Calling gtk_widget_size_request() is not guaranteed to give you the final
size of the widget. It gives you the widgets "requested" size. If the
widget it put in a box, for example, it will generally expand to fill a
space (as determined by the packing options).

In your case, however, this won't explain why you are getting *smaller*
numbers than you should. I had a look at the size_request code for boxes.
It turns out that they don't add in the size of their children until they
are visible. Because the window has not yet been shown when you check the
size, you will just get the border sizes added up.

Hope this helps,

Mike




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