Package: gtk

Class gtk-box

Superclasses

gtk-container, gtk-widget, g-initially-unowned, gtk-buildable, gtk-orientable, g-object, common-lisp:standard-object, common-lisp:t

Documented Subclasses

Direct Slots

baseline-position
The baseline-position property of type gtk-baseline-position (Read / Write)
The position of the baseline aligned widgets if extra space is available.
Default value: :center
homogeneous
The homogeneous property of type :boolean (Read / Write)
Whether the children should all be the same size.
Default value: nil
spacing
The spacing property of type :int (Read / Write)
The amount of space between children.
Allowed values: >= 0
Default value: 0

Details

The gtk-box widget organizes child widgets into a rectangular area.

The rectangular area of a gtk-box is organized into either a single row or a single column of child widgets depending upon the orientation. Thus, all children of a gtk-box are allocated one dimension in common, which is the height of a row, or the width of a column.

gtk-box uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a gtk-container. For a gtk-box, there are two reference positions: the start and the end of the box. For a vertical gtk-box, the start is defined as the top of the box and the end is defined as the bottom. For a horizontal gtk-box the start is defined as the left side and the end is defined as the right side.

Use repeated calls to the function gtk-box-pack-start to pack widgets into a gtk-box from start to end. Use the function gtk-box-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.

Because gtk-box is a gtk-container, you may also use the function gtk-container-add to insert widgets into the box, and they will be packed with the default values for the child properties expand and fill.

Use the function gtk-container-remove to remove widgets from the gtk-box.

Use the function gtk-box-homogeneous to specify whether or not all children of the gtk-box are forced to get the same amount of space.

Use the function gtk-box-spacing to determine how much space will be minimally placed between all children in the gtk-box. Note that spacing is added between the children, while padding added by the functions gtk-box-pack-start or gtk-box-pack-end is added on either side of the widget it belongs to.

Use the function gtk-box-reorder-child to move a gtk-box child to a different place in the box.

Use the function gtk-box-set-child-packing to reset the expand, fill and padding child properties. Use the function gtk-box-query-child-packing to query these fields.

Note

Note that a single-row or single-column gtk-grid provides exactly the same functionality as gtk-box.

Child Property Details

The expand child property
expand of type :boolean (Read / Write)
Whether the child should receive extra space when the parent grows. Note that the default value for this property is nil for gtk-box. Note that the halign, valign, hexpand and vexpand properties are the preferred way to influence child size allocation in containers.
Default value: nil

The fill child property
fill of type :boolean (Read / Write)
Whether the child should receive extra space when the parent grows. Note that the halign, valign, hexpand and vexpand properties are the preferred way to influence child size allocation in containers.
Default value: true

The pack-type child property
pack-type of type gtk-pack-type (Read / Write)
A gtk-pack-type indicating whether the child is packed with reference to the start or end of the parent.
Default value: :start

The padding child property
padding of type :uint (Read / Write)
Extra space to put between the child and its neighbors, in pixels.
Allowed values: <= G_MAXINT
Default value: 0

The position child property
position of type :int (Read / Write)
The index of the child in the parent.
Allowed values: <= G_MAXULONG
Default value: 0
 

Slot Access Functions

Inherited Slot Access Functions

See also

2014-2-11