Re: size of individual widgets



Havoc Pennington <hp redhat com> writes:

> > I'm using GTK+ 1.2, and I've tried to look for how to do this in the
> > documentation and the FAQ, but couldn't find anything about it. Is it
> > possible to find out the size of individual widgets like this?
> 
> The button won't get a size allocation until it's onscreen.
> 
> You can just call gtk_widget_size_request() to see what size it would
> have requested. (This isn't necessarily the size it will end up with
> in all cases if you put it onscreen, but is the "natural" size of the
> button.)

Ok. I managed to find another way of doing this. I created a window
which I placed the button in. I then called gtk_widget_realize() on
the window. Then the button had gotten an allocated size. Then I just
destroy the whole window.


Tomas




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