Re: How to center vbox inside full screen window



Both GtkImage and GtkLabel are subclasses of GtkMisc, which means that you
can set their alignments through the GtkMisc methods. Thus after after
packing them together, set the yalignment of the image to 1.0 and the
yalignment of the label to 0.0 (default for both are 0.5) and you should be
ok.

Search for GtkMisc in the GtkLabel and GtkImage documentations.

Another option is to create another non-filled GtkVBox into which you place
the image and the label, and then place this vbox in your outer filled vbox.

Hope this helps,
Dov

2008/8/30 Christian Smith <Christian Smith sun com>

Hi All,

I have a very simple GTK program (in C) that creates a full screen window.
 Inside the full screen window I am placing a vbox with two elements inside:
and image and a label.

For the life of me I cannot figure out how to get the contents of the vbox
to be packed together.  I.e. I want the image + label touching each other
and centered on the screen.  Currently the height of the vbox seems to fill
the height of the screen with the image and label distributed inside (and
not touching).

Any help is appreciated!

Thanks,
Christian
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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