GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Nov 23, 2014 9:09 pm

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 
Offline

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?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 22, 2007 10:44 pm 
Offline
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: http://library.gnome.org/devel/gtk/unst ... ze-request

The GtkContainer has a small explaination about size allocation in GTK+: http://library.gnome.org/devel/gtk/unst ... #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!


Top
 Profile  
 
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: Google Adsense [Bot], Yahoo [Bot] and 3 guests


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