[Glade-users] strategy for resizing / centering

Yeah, you're best off getting rid of GtkFixed entirely and instead 
learning how to properly use GTK's packing and container scheme. It may 
not seem intuitive at first if you're coming from a Visual C++ or Visual 
Basic background, however, once you learn it you'll absolutely love it.

GTK+ will handle resizing and positioning of your widgets for you. All 
you need to do is tell GTK what to do with extra space and how to pack 
children within their containers. Take a look at the "How Packing 
Effects the Layout" section in my GTK+ and Glade3 GUI Programming 

As for aligning your widgets, be it centered, left, or right, take 
notice of widgets which are derived from GtkMisc such as a GtkLabel. 
With those, you can use gtk_misc_set_alignment() to set the alignment 
from 0 to 1 where 0 is left, 0.5 is center, and 1 is right. If the 
widget is not derived from GtkMisc, you can place the widget in a 
GtkAlignment widget.

- Micah Carrick

  Developer - http://www.micahcarrick.com
  GTK+ Forums - http://www.gtkforums.com

Travis Staloch wrote:
I have a glade app which has been created with GtkFixed widgets as the 
first children of all of its GtkWindow widgets.  Up until now, the app 
hasn't supported resizing and all the controls are layed out using 
fixed positioning.  But I'm hoping to change this to allow resizing 
and find a good layout scheme where the edges of the GtkFixed widgets 
are 'tied' to the edges of the GtkWindow whenever it resizes.  Can 
anyone recommend a way to accomplish this?  Will I need to use 
something other than the GtkFixed widget?  Also, how to keep a control 
centered or left aligned?



Looking for last minute shopping deals? Find them fast with Yahoo! 


Glade-users maillist  -  Glade-users at lists.ximian.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20071230/ab7c436b/attachment.html 

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