Index

Package: Box

Description

package Gtk.Box is

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.

Screenshot

gtk-box.png
<testgtk>create_box.adb</testgtk>

Packages

Implements_Buildable (new Glib.Types.Implements)

Implements_Orientable (new Glib.Types.Implements)

Classes

Gtk_Box_Record

type Gtk_Box_Record is new Gtk_Container_Record with null record;

Ancestors:

Immediate Children:

Primitive operations:

Get_Homogeneous
Get_Orientation
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Gtk.Container.Add (Inherited)
Gtk.Container.Check_Resize (Inherited)
Gtk.Container.Child_Get_Property (Inherited)
Gtk.Container.Child_Set_Property (Inherited)
Gtk.Container.Child_Type (Inherited)
Gtk.Container.Forall (Inherited)
Gtk.Container.Foreach (Inherited)
Gtk.Container.Get_Border_Width (Inherited)
Gtk.Container.Get_Children (Inherited)
Gtk.Container.Get_Focus_Chain (Inherited)
Gtk.Container.Get_Focus_Child (Inherited)
Gtk.Container.Get_Focus_Hadjustment (Inherited)
Gtk.Container.Get_Focus_Vadjustment (Inherited)
Gtk.Container.Get_Resize_Mode (Inherited)
Gtk.Container.Propagate_Expose (Inherited)
Gtk.Container.Remove (Inherited)
Gtk.Container.Resize_Children (Inherited)
Gtk.Container.Set_Border_Width (Inherited)
Gtk.Container.Set_Focus_Chain (Inherited)
Gtk.Container.Set_Focus_Child (Inherited)
Gtk.Container.Set_Focus_Hadjustment (Inherited)
Gtk.Container.Set_Focus_Vadjustment (Inherited)
Gtk.Container.Set_Reallocate_Redraws (Inherited)
Gtk.Container.Set_Resize_Mode (Inherited)
Gtk.Container.Unset_Focus_Chain (Inherited)
Gtk.Widget.Activate (Inherited)
Gtk.Widget.Add_Accelerator (Inherited)
Gtk.Widget.Add_Events (Inherited)
Gtk.Widget.Add_Mnemonic_Label (Inherited)
Gtk.Widget.Can_Activate_Accel (Inherited)
Gtk.Widget.Child_Notify (Inherited)
Gtk.Widget.Class_Path (Inherited)
Gtk.Widget.Class_Path_Reversed (Inherited)
Gtk.Widget.Create_Pango_Context (Inherited)
Gtk.Widget.Create_Pango_Layout (Inherited)
Gtk.Widget.Destroy (Inherited)
Gtk.Widget.Draw (Inherited)
Gtk.Widget.Ensure_Style (Inherited)
Gtk.Widget.Error_Bell (Inherited)
Gtk.Widget.Flag_Is_Set (Inherited)
Gtk.Widget.Flags (Inherited)
Gtk.Widget.Freeze_Child_Notify (Inherited)
Gtk.Widget.Get_Allocation_Height (Inherited)
Gtk.Widget.Get_Allocation_Width (Inherited)
Gtk.Widget.Get_Allocation_X (Inherited)
Gtk.Widget.Get_Allocation_Y (Inherited)
Gtk.Widget.Get_Ancestor (Inherited)
Gtk.Widget.Get_Child_Requisition (Inherited)
Gtk.Widget.Get_Child_Visible (Inherited)
Gtk.Widget.Get_Colormap (Inherited)
Gtk.Widget.Get_Composite_Name (Inherited)
Gtk.Widget.Get_Direction (Inherited)
Gtk.Widget.Get_Events (Inherited)
Gtk.Widget.Get_Extension_Events (Inherited)
Gtk.Widget.Get_Has_Tooltip (Inherited)
Gtk.Widget.Get_Name (Inherited)
Gtk.Widget.Get_No_Show_All (Inherited)
Gtk.Widget.Get_Pango_Context (Inherited)
Gtk.Widget.Get_Parent (Inherited)
Gtk.Widget.Get_Parent_Window (Inherited)
Gtk.Widget.Get_Pointer (Inherited)
Gtk.Widget.Get_Root_Window (Inherited)
Gtk.Widget.Get_Size_Request (Inherited)
Gtk.Widget.Get_Snapshot (Inherited)
Gtk.Widget.Get_State (Inherited)
Gtk.Widget.Get_Style (Inherited)
Gtk.Widget.Get_Tooltip_Markup (Inherited)
Gtk.Widget.Get_Tooltip_Text (Inherited)
Gtk.Widget.Get_Tooltip_Window (Inherited)
Gtk.Widget.Get_Toplevel (Inherited)
Gtk.Widget.Get_Visual (Inherited)
Gtk.Widget.Get_Window (Inherited)
Gtk.Widget.Grab_Default (Inherited)
Gtk.Widget.Grab_Focus (Inherited)
Gtk.Widget.Has_Screen (Inherited)
Gtk.Widget.Hide (Inherited)
Gtk.Widget.Hide_All (Inherited)
Gtk.Widget.Input_Shape_Combine_Mask (Inherited)
Gtk.Widget.Intersect (Inherited)
Gtk.Widget.Is_Ancestor (Inherited)
Gtk.Widget.Is_Composited (Inherited)
Gtk.Widget.Is_Focus (Inherited)
Gtk.Widget.Keynav_Failed (Inherited)
Gtk.Widget.List_Mnemonic_Labels (Inherited)
Gtk.Widget.Map (Inherited)
Gtk.Widget.Mnemonic_Activate (Inherited)
Gtk.Widget.Modify_Base (Inherited)
Gtk.Widget.Modify_Bg (Inherited)
Gtk.Widget.Modify_Cursor (Inherited)
Gtk.Widget.Modify_Fg (Inherited)
Gtk.Widget.Modify_Font (Inherited)
Gtk.Widget.Modify_Text (Inherited)
Gtk.Widget.Path (Inherited)
Gtk.Widget.Path_Reversed (Inherited)
Gtk.Widget.Queue_Clear (Inherited)
Gtk.Widget.Queue_Clear_Area (Inherited)
Gtk.Widget.Queue_Draw (Inherited)
Gtk.Widget.Queue_Draw_Area (Inherited)
Gtk.Widget.Queue_Resize (Inherited)
Gtk.Widget.Queue_Resize_No_Redraw (Inherited)
Gtk.Widget.Realize (Inherited)
Gtk.Widget.Region_Intersect (Inherited)
Gtk.Widget.Remove_Accelerator (Inherited)
Gtk.Widget.Remove_Mnemonic_Label (Inherited)
Gtk.Widget.Render_Icon (Inherited)
Gtk.Widget.Reparent (Inherited)
Gtk.Widget.Reset_Rc_Styles (Inherited)
Gtk.Widget.Reset_Shapes (Inherited)
Gtk.Widget.Restore_Default_Style (Inherited)
Gtk.Widget.Send_Expose (Inherited)
Gtk.Widget.Set_Accel_Path (Inherited)
Gtk.Widget.Set_App_Paintable (Inherited)
Gtk.Widget.Set_Child_Visible (Inherited)
Gtk.Widget.Set_Colormap (Inherited)
Gtk.Widget.Set_Composite_Name (Inherited)
Gtk.Widget.Set_Direction (Inherited)
Gtk.Widget.Set_Double_Buffered (Inherited)
Gtk.Widget.Set_Events (Inherited)
Gtk.Widget.Set_Extension_Events (Inherited)
Gtk.Widget.Set_Flags (Inherited)
Gtk.Widget.Set_Has_Tooltip (Inherited)
Gtk.Widget.Set_Name (Inherited)
Gtk.Widget.Set_No_Show_All (Inherited)
Gtk.Widget.Set_Parent (Inherited)
Gtk.Widget.Set_Parent_Window (Inherited)
Gtk.Widget.Set_Redraw_On_Allocate (Inherited)
Gtk.Widget.Set_Scroll_Adjustments (Inherited)
Gtk.Widget.Set_Sensitive (Inherited)
Gtk.Widget.Set_Size_Request (Inherited)
Gtk.Widget.Set_State (Inherited)
Gtk.Widget.Set_Style (Inherited)
Gtk.Widget.Set_Tooltip_Markup (Inherited)
Gtk.Widget.Set_Tooltip_Text (Inherited)
Gtk.Widget.Set_Tooltip_Window (Inherited)
Gtk.Widget.Set_UPosition (Inherited)
Gtk.Widget.Set_USize (Inherited)
Gtk.Widget.Set_Window (Inherited)
Gtk.Widget.Shape_Combine_Mask (Inherited)
Gtk.Widget.Show (Inherited)
Gtk.Widget.Show_All (Inherited)
Gtk.Widget.Show_Now (Inherited)
Gtk.Widget.Size_Allocate (Inherited)
Gtk.Widget.Size_Request (Inherited)
Gtk.Widget.Style_Get_Property (Inherited)
Gtk.Widget.Thaw_Child_Notify (Inherited)
Gtk.Widget.Trigger_Tooltip_Query (Inherited)
Gtk.Widget.Unmap (Inherited)
Gtk.Widget.Unrealize (Inherited)
Gtk.Widget.Unset_Flags (Inherited)
Pack_End_Defaults
Pack_Start_Defaults
Query_Child_Packing
Reorder_Child
Set_Child_Packing
Set_Homogeneous
Set_Orientation

Types

Gtk_Box

type Gtk_Box is access all Gtk_Box_Record'Class;

Gtk_Hbox_Record

subtype Gtk_Hbox_Record is Gtk_Box_Record;

Gtk_Hbox

subtype Gtk_Hbox is Gtk_Box;

Gtk_Vbox_Record

subtype Gtk_Vbox_Record is Gtk_Box_Record;

Gtk_Vbox

subtype Gtk_Vbox is Gtk_Box;

Constants & Global variables

Homogeneous_Property (Glib.Properties.Property_Boolean)

Homogeneous_Property : constant Glib.Properties.Property_Boolean;

Subprograms & Entries

Get_Type

function Get_Type return Glib.GType;

Gtk_New_Hbox

procedure Gtk_New_Hbox 
(Box: out Gtk_Hbox;
Homogeneous: Boolean := False;
Spacing: Gint := 0);

Initialize_Hbox

procedure Initialize_Hbox 
(Box: access Gtk_Hbox_Record'Class;
Homogeneous: Boolean := False;
Spacing: Gint := 0);
Creates a new Gtk.Box.Gtk_Hbox. "homogeneous": True if all children are to be given equal space allotments. "spacing": the number of pixels to place by default between children.

Get_Hbox_Type

function Get_Hbox_Type return Glib.GType;

Gtk_New_Vbox

procedure Gtk_New_Vbox 
(Box: out Gtk_Vbox;
Homogeneous: Boolean := False;
Spacing: Gint := 0);

Initialize_Vbox

procedure Initialize_Vbox 
(Box: access Gtk_Vbox_Record'Class;
Homogeneous: Boolean := False;
Spacing: Gint := 0);
Creates a new Gtk.Box.Gtk_Vbox. "homogeneous": True if all children are to be given equal space allotments. "spacing": the number of pixels to place by default between children.

Get_Vbox_Type

function Get_Vbox_Type return Glib.GType;

Get_Homogeneous

function Get_Homogeneous 
(Box: access Gtk_Box_Record) return Boolean;

Set_Homogeneous

procedure Set_Homogeneous 
(Box: access Gtk_Box_Record;
Homogeneous: Boolean);
Sets the Gtk.Box.Gtk_Box:homogeneous property of Box, controlling whether or not all children of Box are given equal space in the box. "homogeneous": a boolean value, True to create equal allotments, False for variable allotments

Get_Spacing

function Get_Spacing 
(Box: access Gtk_Box_Record) return Gint;

Set_Spacing

procedure Set_Spacing 
(Box: access Gtk_Box_Record;
Spacing: Gint);
Sets the Gtk.Box.Gtk_Box:spacing property of Box, which is the number of pixels to place between children of Box. "spacing": the number of pixels to put between children

Pack_End

procedure Pack_End 
(In_Box: access Gtk_Box_Record;
Child: access Gtk.Widget.Gtk_Widget_Record'Class;
Expand: Boolean := True;
Fill: Boolean := True;
Padding: Guint := 0);
Adds Child to Box, packed with reference to the end of Box. The Child is packed after (away from end of) any other child packed with reference to the end of Box. "child": the Gtk.Widget.Gtk_Widget to be added to Box "expand": True if the new child is to be given extra space allocated to Box. The extra space will be divided evenly between all children of Box that use this option "fill": True if space given to Child by the Expand option is actually allocated to Child, rather than just padding it. This parameter has no effect if Expand is set to False. A child is always allocated the full height of a Gtk.Box.Gtk_Hbox and the full width of a Gtk.Box.Gtk_Vbox. This option affects the other dimension "padding": extra space in pixels to put between this child and its neighbors, over and above the global amount specified by Gtk.Box.Gtk_Box:spacing property. If Child is a widget at one of the reference ends of Box, then Padding pixels are also put between

Pack_End_Defaults

procedure Pack_End_Defaults 
(Box: access Gtk_Box_Record;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class);

Pack_Start

procedure Pack_Start 
(In_Box: access Gtk_Box_Record;
Child: access Gtk.Widget.Gtk_Widget_Record'Class;
Expand: Boolean := True;
Fill: Boolean := True;
Padding: Guint := 0);
Adds Child to Box, packed with reference to the start of Box. The Child is packed after any other child packed with reference to the start of Box. "child": the Gtk.Widget.Gtk_Widget to be added to Box "expand": True if the new child is to be given extra space allocated to "fill": True if space given to Child by the Expand option is actually allocated to Child, rather than just padding it. This parameter has no effect if Expand is set to False. A child is always allocated the full height of a Gtk.Box.Gtk_Hbox and the full width of a Gtk.Box.Gtk_Vbox. This option affects the other dimension "padding": extra space in pixels to put between this child and its neighbors, over and above the global amount specified by Gtk.Box.Gtk_Box:spacing property. If Child is a widget at one of the reference ends of Box, then Padding pixels are also put between

Pack_Start_Defaults

procedure Pack_Start_Defaults 
(Box: access Gtk_Box_Record;
Widget: access Gtk.Widget.Gtk_Widget_Record'Class);

Query_Child_Packing

procedure Query_Child_Packing 
(Box: access Gtk_Box_Record;
Child: access Gtk.Widget.Gtk_Widget_Record'Class;
Expand: out Boolean;
Fill: out Boolean;
Padding: out Guint;
Pack_Type: out Gtk.Enums.Gtk_Pack_Type);

Set_Child_Packing

procedure Set_Child_Packing 
(Box: access Gtk_Box_Record;
Child: access Gtk.Widget.Gtk_Widget_Record'Class;
Expand: Boolean;
Fill: Boolean;
Padding: Guint;
Pack_Type: Gtk.Enums.Gtk_Pack_Type);
Sets the way Child is packed into Box. "child": the Gtk.Widget.Gtk_Widget of the child to set "expand": the new value of the Gtk.Box.Gtk_Box:expand child property "fill": the new value of the Gtk.Box.Gtk_Box:fill child property "padding": the new value of the Gtk.Box.Gtk_Box:padding child property "pack_type": the new value of the Gtk.Box.Gtk_Box:pack-type child property

Reorder_Child

procedure Reorder_Child 
(Box: access Gtk_Box_Record;
Child: access Gtk.Widget.Gtk_Widget_Record'Class;
Position: Gint);
Moves Child to a new Position in the list of Box children. The list is the <structfield>children</structfield> field of Gtk.Box.Gtk_Box-struct, and contains both widgets packed GTK_PACK_START as well as widgets packed GTK_PACK_END, in the order that these widgets were added to Box. A widget's position in the Box children list determines where the widget is packed into Box. A child widget at some position in the list will be packed just after all other widgets of the same packing type that appear earlier in the list. "child": the Gtk.Widget.Gtk_Widget to move "position": the new position for Child in the list of children of Box, starting from 0. If negative, indicates the end of the list

Get_Child

function Get_Child 
(Box: access Gtk_Box_Record;
Num: Gint) return Gtk.Widget.Gtk_Widget;
Return the Num-th child of the box, or null if there is no such child Since: gtk+ GtkAda 1.0

Get_Orientation

function Get_Orientation 
(Self: access Gtk_Box_Record) return Gtk.Enums.Gtk_Orientation;

Set_Orientation

procedure Set_Orientation 
(Self: access Gtk_Box_Record;
Orientation: Gtk.Enums.Gtk_Orientation);