RE: How to get the widget's current width and height?



On Tue, 2003-11-18 at 15:29, Tom Liu wrote:
gdk_drawable_get_size(w->window,&wid,&hi); may work for the widget which
has a xwindow such as eventbox. For vbox, label, button etc. It will not
work.
Can't believe there is no function to retrive size of widget?!

I'd connect to the "size-allocate" signal and accumulate the size of the
widget you are interested in. Alternatively, you can trigger size
allocation for this widget with:

http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#gtk-widget-size-request
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#gtk-widget-get-size-request



-----Original Message-----
From: gtk-app-devel-list-admin gnome org
[mailto:gtk-app-devel-list-admin gnome org] On Behalf Of Tom Liu
Sent: Tuesday, November 18, 2003 9:20 AM
To: 'Gus Koppel'; gtk-app-devel-list gnome org
Subject: RE: How to get the widget's current width and height?

gtk_widget_get_child_requisition () only retrive the computed the size
request and fill in widget->requisition

I don't think this function will return the current size of this widget.





Try
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#gtk-widget-get
-child-requisition
and see
http://developer.gnome.org/doc/API/2.0/gtk/GtkWidget.html#GtkRequisition
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
-- 
Mathieu Lacage <mathieu gnu org>





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