GtkVBox Constructor

GtkVBox ([bool homogeneous = false [, int spacing = 0]]);

Creates a new vertical box container for packing child widgets into a column.

The parameter homogeneous is a boolean value which defines whether all child widgets in the box should be assigned the height of the tallest widget. The default behaviour (false) is to maintain the individual height of the widgets unchanged. The second parameter, spacing, defines the minimum number of pixels to be left between widgets.

Example 144. GtkHBox and GtkVBox packing demonstration

//Here we create the GtkWindow
$window = new GtkWindow();
$window->set_title("GtkHBox and GtkVBox packing demonstration");
$window->connect_simple("destroy", array("gtk", "main_quit"));

//Adding a GtkVBox to our $window
$vbox = new GtkVBox(false, 5);

//Let's add a GtkLabel as the first (topmost) widget in our $vbox
$label = new GtkLabel();
$label->set_text("This GtkLabel is packed at the start of a GtkVBox.
The GtkCalendar and the empty GtkTextView below are packed, respectively,
at the start and the end of a GtkHBox, which is in turn packed at the end
of the GtkVBox.");
$vbox->pack_start($label, true, true, 5);

//Adding a GtkHBox to the end (bottom) of the $vbox
$hbox = new GtkHBox(true, 0);

//Here we'll add GtkCalendar to the start (ie. the left) of the $hbox
$calendar = new GtkCalendar();
$hbox->pack_start($calendar, true, true, 2);

//Adding a GtkTextView to the end (ie. the right) fo the $hbox
$text = new GtkTextView();
$hbox->pack_end($text, true, true, 2);