package Implements_Gtk_Buildable is new Glib.Types.Implements (Gtk.Buildable.Gtk_Buildable, Gtk_Box_Record, Gtk_Box);
package Implements_Gtk_Orientable is new Glib.Types.Implements (Gtk.Orientable.Gtk_Orientable, Gtk_Box_Record, Gtk_Box);
type Gtk_Box_Record is new Gtk_Container_Record with null record;
type Gtk_Box is access all Gtk_Box_Record'Class;
subtype Gtk_Hbox_Record is Gtk_Box_Record;
subtype Gtk_Hbox is Gtk_Box;
subtype Gtk_Vbox_Record is Gtk_Box_Record;
subtype Gtk_Vbox is Gtk_Box;
Homogeneous_Property : constant Glib.Properties.Property_Boolean;
Spacing_Property : constant Glib.Properties.Property_Int;
procedure Gtk_New
| ( | Box | : out Gtk_Box; |
| Orientation | : Gtk.Enums.Gtk_Orientation; | |
| Spacing | : Gint); |
procedure Initialize
| ( | Box | : not null access Gtk_Box_Record'Class; |
| Orientation | : Gtk.Enums.Gtk_Orientation; | |
| Spacing | : Gint); |
function Gtk_Box_New
| ( | Orientation | : Gtk.Enums.Gtk_Orientation; |
| Spacing | : Gint) return Gtk_Box; |
function Get_Type return Glib.GType;
procedure Initialize_Hbox
| ( | Box | : not null access Gtk_Hbox_Record'Class; |
| Homogeneous | : Boolean := False; | |
| Spacing | : Gint := 0); |
function Get_Hbox_Type return Glib.GType;
procedure Initialize_Vbox
| ( | Box | : not null access Gtk_Vbox_Record'Class; |
| Homogeneous | : Boolean := False; | |
| Spacing | : Gint := 0); |
function Get_Vbox_Type return Glib.GType;
function Get_Homogeneous
| ( | Box | : not null access Gtk_Box_Record) return Boolean; |
procedure Set_Homogeneous
| ( | Box | : not null access Gtk_Box_Record; |
| Homogeneous | : Boolean); |
function Get_Spacing
| ( | Box | : not null access Gtk_Box_Record) return Gint; |
procedure Set_Spacing
| ( | Box | : not null access Gtk_Box_Record; |
| Spacing | : Gint); |
procedure Pack_End
| ( | In_Box | : not null access Gtk_Box_Record; |
| Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
| Expand | : Boolean := True; | |
| Fill | : Boolean := True; | |
| Padding | : Guint := 0); |
procedure Pack_Start
| ( | In_Box | : not null access Gtk_Box_Record; |
| Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
| Expand | : Boolean := True; | |
| Fill | : Boolean := True; | |
| Padding | : Guint := 0); |
procedure Query_Child_Packing
| ( | Box | : not null access Gtk_Box_Record; |
| Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
| Expand | : out Boolean; | |
| Fill | : out Boolean; | |
| Padding | : out Guint; | |
| Pack_Type | : out Gtk.Enums.Gtk_Pack_Type); |
procedure Set_Child_Packing
| ( | Box | : not null access Gtk_Box_Record; |
| Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
| Expand | : Boolean; | |
| Fill | : Boolean; | |
| Padding | : Guint; | |
| Pack_Type | : Gtk.Enums.Gtk_Pack_Type); |
procedure Reorder_Child
| ( | Box | : not null access Gtk_Box_Record; |
| Child | : not null access Gtk.Widget.Gtk_Widget_Record'Class; | |
| Position | : Gint); |
function Get_Child
| ( | Box | : not null access Gtk_Box_Record; |
| Num | : Gint) return Gtk.Widget.Gtk_Widget; |
function Get_Orientation
| ( | Self | : not null access Gtk_Box_Record) return Gtk.Enums.Gtk_Orientation; |
procedure Set_Orientation
| ( | Self | : not null access Gtk_Box_Record; |
| Orientation | : Gtk.Enums.Gtk_Orientation); |
function "+"
| ( | Widget | : access Gtk_Box_Record'Class) return Gtk.Buildable.Gtk_Buildable renames Implements_Gtk_Buildable.To_Interface; |
function "-"
| ( | Interf | : Gtk.Buildable.Gtk_Buildable) return Gtk_Box renames Implements_Gtk_Buildable.To_Object; |
function "+"
| ( | Widget | : access Gtk_Box_Record'Class) return Gtk.Orientable.Gtk_Orientable renames Implements_Gtk_Orientable.To_Interface; |
function "-"
| ( | Interf | : Gtk.Orientable.Gtk_Orientable) return Gtk_Box renames Implements_Gtk_Orientable.To_Object; |
The GtkBox widget organizes child widgets into a rectangular area.
The rectangular area of a GtkBox is organized into either a single row or a single column of child widgets depending upon the orientation. Thus, all children of a GtkBox are allocated one dimension in common, which is the height of a row, or the width of a column.
GtkBox uses a notion of *packing*. Packing refers to adding widgets with reference to a particular position in a Gtk.Container.Gtk_Container. For a GtkBox, there are two reference positions: the *start* and the *end* of the box. For a vertical Gtk.Box.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.Gtk_Box the start is defined as the left side and the end is defined as the right side.
Use repeated calls to Gtk.Box.Pack_Start to pack widgets into a GtkBox from start to end. Use 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 GtkBox.
Because GtkBox is a Gtk.Container.Gtk_Container, you may also use Gtk.Container.Add to insert widgets into the box, and they will be packed with the default values for Gtk.Box.Gtk_Box:expand and Gtk.Box.Gtk_Box:fill. Use Gtk.Container.Remove to remove widgets from the GtkBox.
Use Gtk.Box.Set_Homogeneous to specify whether or not all children of the GtkBox are forced to get the same amount of space.
Use Gtk.Box.Set_Spacing to determine how much space will be minimally placed between all children in the GtkBox. Note that spacing is added *between* the children, while padding added by Gtk.Box.Pack_Start or Gtk.Box.Pack_End is added *on either side* of the widget it belongs to.
Use Gtk.Box.Reorder_Child to move a GtkBox child to a different place in the box.
Use Gtk.Box.Set_Child_Packing to reset the Gtk.Box.Gtk_Box:expand, Gtk.Box.Gtk_Box:fill and Gtk.Box.Gtk_Box:padding child properties. Use Gtk.Box.Query_Child_Packing to query these fields.
Note: Note that a single-row or single-column Gtk.Grid.Gtk_Grid provides exactly the same functionality as Gtk.Box.Gtk_Box.