 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
pulis
Joined: 22 Aug 2007 Posts: 3
|
Posted: Wed Aug 22, 2007 12:19 pm Post subject: newbie question / c/c++ |
|
|
ok, when i create a new
GtkWidget *box = gtk_vbox_new (TRUE,0);
and add widgets in it, the widgets have exactly same height.
so, what command resizes those widgets? |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 386 Location: Fairfax, Virginia
|
Posted: Wed Aug 22, 2007 10:44 pm Post subject: |
|
|
If you add children to a GtkVBox with gtk_box_pack_start/end_defaults(), then all of the children will expand. You can use the widget's homogenous property to enforce the same size. If you want them to use different sizes, use gtk_box_pack_start/end(). (You can experiment with how the expand, fill, and padding parameters of this function work in Glade.)
You can force a widget to a size with gtk_widget_set_size_request(), although this request may not be honored if GTK+ sees fit (it is too big/small). Find out more about this function here: http://library.gnome.org/devel/gtk/unstable/GtkWidget.html#gtk-widget-set-size-request
The GtkContainer has a small explaination about size allocation in GTK+: http://library.gnome.org/devel/gtk/unstable/GtkContainer.html#id4092216
In addition, my book (Foundations of GTK+ Development) has a whole chapter dedicated to container widgets, and issues such as this. I hope this helps! |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|