GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

newbie question / c/c++

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
pulis



Joined: 22 Aug 2007
Posts: 3

PostPosted: Wed Aug 22, 2007 12:19 pm    Post subject: newbie question / c/c++ Reply with quote

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

PostPosted: Wed Aug 22, 2007 10:44 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP