![]() |
![]() |
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. The last widget added with pack_start() will be placed just before the last widget added with pack_end()
Because Gtk::Box is a Gtk::Container, you may also use Gtk::Container::add() to insert widgets, and they will be packed as if with pack_start(). Use Gtk::Container::remove() to remove widgets.
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.
Public Types | |
typedef Box_Helpers::BoxList | BoxList |
Public Member Functions | |
const BoxList& | children () const |
BoxList& | children () |
bool | get_homogeneous () const |
Returns whether the box is homogeneous (all children are the same size). | |
int | get_spacing () const |
Gets the value set by set_spacing(). | |
const GtkBox* | gobj () const |
Provides access to the underlying C GtkObject. | |
GtkBox* | gobj () |
Provides access to the underlying C GtkObject. | |
void | pack_end (Widget& child, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0) |
Right side insert a widget to a box. | |
void | pack_end (Widget& child, bool expand, bool fill, guint padding=0) |
void | pack_start (Widget& child, PackOptions options=PACK_EXPAND_WIDGET, guint padding=0) |
Left side insert a widget to a box. | |
void | pack_start (Widget& child, bool expand, bool fill, guint padding=0) |
Left side insert a widget to a box. | |
Glib::PropertyProxy_ReadOnly< bool > | property_homogeneous () const |
Whether the children should all be the same size. | |
Glib::PropertyProxy<bool> | property_homogeneous () |
Whether the children should all be the same size. | |
Glib::PropertyProxy_ReadOnly< int > | property_spacing () const |
The amount of space between children. | |
Glib::PropertyProxy<int> | property_spacing () |
The amount of space between children. | |
void | reorder_child (Widget& child, int pos) |
void | set_homogeneous (bool homogeneous=true) |
void | set_spacing (int spacing) |
virtual | ~Box () |
Protected Member Functions | |
Box () | |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Box* | wrap (GtkBox* object, bool take_copy=false) |
|
|
|
|
|
|
|
|
|
|
|
Returns whether the box is homogeneous (all children are the same size). See set_homogeneous().
|
|
Gets the value set by set_spacing().
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. Reimplemented in Gtk::VBox, Gtk::HBox, Gtk::ButtonBox, Gtk::VButtonBox, Gtk::HButtonBox, Gtk::ColorSelection, Gtk::Combo, Gtk::GammaCurve, Gtk::FileChooserButton, Gtk::FileChooserWidget, Gtk::FontSelection, Gtk::RecentChooserWidget, and Gtk::Statusbar. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Container. Reimplemented in Gtk::VBox, Gtk::HBox, Gtk::ButtonBox, Gtk::VButtonBox, Gtk::HButtonBox, Gtk::ColorSelection, Gtk::Combo, Gtk::GammaCurve, Gtk::FileChooserButton, Gtk::FileChooserWidget, Gtk::FontSelection, Gtk::RecentChooserWidget, and Gtk::Statusbar. |
|
Right side insert a widget to a box.
|
|
|
|
Left side insert a widget to a box.
|
|
Left side insert a widget to a box.
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 allocated to it (
The fill argument to the pack_start()/pack_end() functions control whether the extra space is allocated to the objects themselves ( The difference between spacing (set when the box is created) and padding (set when elements are packed) is, that spacing is added between objects, and padding is added on either side of an object. |
|
Whether the children should all be the same size. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Whether the children should all be the same size. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The amount of space between children. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
The amount of space between children. You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
|
|
|
|
|
|
|