Abstract base class for horizontal and vertical boxes, which organize a variable number of widgets into a rectangular area. This is an abstract class and it defers choice of which way the widgets are packed to the screen to the derived classes. It provides a common interface for inserting widgets to a box indepenently of how it is shown in the screen.
Gtk::Box uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a Gtk::Container. There are two reference positions: the start and the end of the box. For a VBox, the start is defined as the top of the box and the end is defined as the bottom. For a HBox the start is defined as the left side and the end is defined as the right side. Use repeated calls to pack_start() to pack widgets into a Gtk::Box from start to end. Use pack_end() to add widgets from end to start. You may intersperse these calls and add widgets from both ends of the same Gtk::Box.
Use set_homogeneous() to specify whether or not all children of the Gtk::Box occupy the same amount of space. Use set_spacing() to determine the minimum space placed between all children in the Gtk::Box. Use reorder_child() to move a child widget to a different place in the box. Use set_child_packing() to reset the pack options and padding attributes of any Gtk::Box child. Use query_child_packing() to query these fields.
The expand argument to {pack_start()} or {pack_end()} controls whether the widgets are laid out in the box to {fill} in all the extra space in the box so the box is expanded to fill the area alloted to it ({ true}). Or the box is shrunk to just fit the widgets ({ false}). Setting {expand} to { false} will allow you to do right and left justifying of your widgets. Otherwise, they will all expand to fit in the box, and the same effect could be achieved by using only one of {pack_start()} or {pack_end()} functions.
The fill argument to the {pack_start()}/{pack_end()} functions control whether the extra space is allocated to the objects themselves ({ true}), or as extra padding in the box around these objects ({ false}). It only has an effect if the {expand} argument is also { true}.
The difference between spacing (set when the box is created) and {padding} (set when elements are packed), spacing is added between objects, and {padding} is added on either side of an object.