Re: [gtk-list] how to find widget size?



Hello,

> any way to find out the size (in pixels) of a widget that you have the
> pointer to.
> 
> i.e. something like 
> get_widget_size( GtkWidget *widget, gint *width, gint *height );

I both tried:

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

or from the Gdk-layer:

gint width, height;

gdk_window_get_size(widget->window, &width, &height);

and both solutions have worked for me.

Regards,

Stephan

-- 
Stephan Krings                                       Freie Universitaet Berlin
AG Kommunikationsserver      Zentraleinrichtung fuer Datenverarbeitung (ZEDAT)
slothkri@zedat.fu-berlin.de                                      Fabeckstr. 32
Tel: +49 30 838 3239                   				  14195 Berlin



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