GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 25, 2016 4:28 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: newbie question / c/c++
PostPosted: Wed Aug 22, 2007 12:19 pm 

Joined: Wed Aug 22, 2007 12:13 pm
Posts: 3
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?

 Post subject:
PostPosted: Wed Aug 22, 2007 10:44 pm 
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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: ... ze-request

The GtkContainer has a small explaination about size allocation in GTK+: ... #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!

Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group