type Gtk_Box_Record is new Gtk.Container.Gtk_Container_Record with private;
subtype Gtk_Hbox_Record is Gtk_Box_Record;
subtype Gtk_Vbox_Record is Gtk_Box_Record;
type Gtk_Box is access all Gtk_Box_Record'Class;
subtype Gtk_Hbox is Gtk_Box;
subtype Gtk_Vbox is Gtk_Box;
Spacing_Property : constant Glib.Properties.Property_Int;
Homogeneous_Property : constant Glib.Properties.Property_Boolean;
Expand_Property : constant Glib.Properties.Property_Boolean;
Fill_Property : constant Glib.Properties.Property_Boolean;
Pack_Type_Property : constant Gtk.Enums.Property_Pack_Type;
Padding_Property : constant Glib.Properties.Property_Uint;
Position_Property : constant Glib.Properties.Property_Int;
procedure Initialize_Vbox
( | Box | : access Gtk_Box_Record'Class; |
Homogeneous | : Boolean := False; | |
Spacing | : Gint := 0); |
procedure Initialize_Hbox
( | Box | : access Gtk_Box_Record'Class; |
Homogeneous | : Boolean := False; | |
Spacing | : Gint := 0); |
function Get_Type return Gtk.Gtk_Type;
function Get_Hbox_Type return Gtk.Gtk_Type;
function Get_Vbox_Type return Gtk.Gtk_Type;
procedure Pack_Start
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Expand | : Boolean := True; | |
Fill | : Boolean := True; | |
Padding | : Gint := 0); |
procedure Pack_End
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Expand | : Boolean := True; | |
Fill | : Boolean := True; | |
Padding | : Gint := 0); |
procedure Set_Homogeneous
( | In_Box | : access Gtk_Box_Record; |
Homogeneous | : Boolean); |
function Get_Homogeneous
( | In_Box | : access Gtk_Box_Record) return Boolean; |
procedure Set_Spacing
( | In_Box | : access Gtk_Box_Record; |
Spacing | : Gint); |
function Get_Spacing
( | In_Box | : access Gtk_Box_Record) return Gint; |
procedure Reorder_Child
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Pos | : Guint); |
procedure Set_Child_Packing
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Expand | : Boolean; | |
Fill | : Boolean; | |
Padding | : Gint; | |
Pack_Type | : Gtk.Enums.Gtk_Pack_Type); |
procedure Query_Child_Packing
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class; | |
Expand | : out Boolean; | |
Fill | : out Boolean; | |
Padding | : out Gint; | |
PackType | : out Gtk.Enums.Gtk_Pack_Type); |
function Get_Child
( | Box | : access Gtk_Box_Record; |
Num | : Gint) return Gtk.Widget.Gtk_Widget; |
procedure Pack_Start_Defaults
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class); |
procedure Pack_End_Defaults
( | In_Box | : access Gtk_Box_Record; |
Child | : access Gtk.Widget.Gtk_Widget_Record'Class); |
A box is a container that can have multiple children, organized either horizontally or vertically. Two subtypes are provided, Gtk_Hbox and Gtk_Vbox, to conform to the C API. In Ada, you do not need to distinguish between the two, but note that the Gtk_Box type is conceptually an abstract type: there is no way to create a "Gtk_Box", only ways to create either an horizontal box, or a vertical box.
Children can be added to one of two positions in the box, either at the beginning (ie left or top) or at the end (ie right or bottom). Each of these positions can contain multiple widgets.
Every time a child is added to the start, it is placed to the right (resp. the bottom) of the previous widget added to the start.
Every time a child is added to the end, it is placed to the left (resp. the top) of the previous widget added to the end.
There are a number of parameters to specify the behavior of the box when it is resized, and how the children should be reorganized and/or resized.
See the testgtk example in the GtkAda distribution to see concrete examples on how all the parameters for the boxes work.
Binding from C File version 2.14
<testgtk>create_box.adb</testgtk>