Libraries:Gtk:Gtk:Box
Types
T
Inherits from:GtkBox is an abstract widget which encapsulates functionality for a particular kind of container, one that organizes a variable number of widgets into a rectangular area. GtkBox has a number of derived classes, e.g. Gtk.Gtk.HBox.T and Gtk.Gtk.VBox.T.
The rectangular area of a GtkBox is organized into either a single row or a single column of child widgets depending upon whether the box is of type Gtk.Gtk.HBox.T or Gtk.Gtk.VBox.T, respectively. 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.Gtk.Container.T. For a GtkBox, there are two reference positions: the start and the end of the box. For a Gtk.Gtk.VBox.T, the start is defined as the top of the box and the end is defined as the bottom. For a Gtk.Gtk.HBox.T the start is defined as the left side and the end is defined as the right side.
Use repeated calls to PackStart to pack widgets into a GtkBox from start to end. Use PackEnd to add widgets from end to start. You may intersperse these calls and add widgets from both ends of the same GtkBox.
Use PackStartDefaults or PackEndDefaults to pack widgets into a GtkBox if you do not need to specify the "expand", "fill", or "padding" child properties for the child to be added.
Because GtkBox is a Gtk.Gtk.Container.T, you may also use Gtk.Gtk.Container.Add to insert widgets into the box, and they will be packed as if with PackStartDefaults. Use Gtk.Gtk.Container.Remove to remove widgets from the GtkBox.
Use SetHomogeneous to specify whether or not all children of the GtkBox are forced to get the same amount of space.
Use SetSpacing to determine how much space will be minimally placed between all children in the GtkBox.
Use ReorderChild to move a GtkBox child to a different place in the box.
Use SetChildPacking to reset the "expand", "fill" and "padding" child properties. Use QueryChildPacking to query these fields.
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
Methods
:GetHomogeneous(self @ T) : Std.Symbol.T
Returns whether the box is homogeneous (all children are the same size). See SetHomogeneous.
box | a T |
Returns | TRUE if the box is homogeneous. |
:GetSpacing(self @ T) : Std.Integer.SmallT
:PackEnd(self @ T, child @ Gtk.Gtk.Widget.T, expand @ Std.Symbol.T, fill @ Std.Symbol.T, padding @ Std.Integer.SmallT) : Std.Object.T
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.
box | a T |
child | the Gtk.Gtk.Widget.T 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.Gtk.HBox.T and the full width of a Gtk.Gtk.VBox.T. 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 "spacing" property. If child is a widget at one of the reference ends of box, then padding pixels are also put between child and the reference edge of box |
:PackEndDefaults(self @ T, widget @ Gtk.Gtk.Widget.T) : Std.Object.T
Warning
PackEndDefaults has been deprecated since version 2.14 and should not be used in newly-written code. Use PackEnd
:PackStart(self @ T, child @ Gtk.Gtk.Widget.T, expand @ Std.Symbol.T, fill @ Std.Symbol.T, padding @ Std.Integer.SmallT) : Std.Object.T
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.
box | a T |
child | the Gtk.Gtk.Widget.T 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.Gtk.HBox.T and the full width of a Gtk.Gtk.VBox.T. 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 "spacing" property. If child is a widget at one of the reference ends of box, then padding pixels are also put between child and the reference edge of box |
:PackStartDefaults(self @ T, widget @ Gtk.Gtk.Widget.T) : Std.Object.T
Warning
PackStartDefaults has been deprecated since version 2.14 and should not be used in newly-written code. Use PackStart
:QueryChildPacking(self @ T, child @ Gtk.Gtk.Widget.T, expand @ Std.Object.T, fill @ Std.Object.T, padding @ Std.Object.T, pack_type @ Std.Object.T) : Std.Object.T
Obtains information about how child is packed into box.
box | a T |
child | the Gtk.Gtk.Widget.T of the child to query |
expand | pointer to return location for "expand" child property |
fill | pointer to return location for "fill" child property |
padding | pointer to return location for "padding" child property |
pack_type | pointer to return location for "pack-type" child property |
:ReorderChild(self @ T, child @ Gtk.Gtk.Widget.T, position @ Std.Integer.SmallT) : Std.Object.T
Moves child to a new position in the list of box children. The list is the children field of T, and contains both widgets packed Gtk.Gtk.PackType.Start as well as widgets packed Gtk.Gtk.PackType.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.
box | a T |
child | the Gtk.Gtk.Widget.T 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 |
:SetChildPacking(self @ T, child @ Gtk.Gtk.Widget.T, expand @ Std.Symbol.T, fill @ Std.Symbol.T, padding @ Std.Integer.SmallT, pack_type @ Gtk.Gtk.PackType.T) : Std.Object.T
Sets the way child is packed into box.
box | a T |
child | the Gtk.Gtk.Widget.T of the child to set |
expand | the new value of the "expand" child property |
fill | the new value of the "fill" child property |
padding | the new value of the "padding" child property |
pack_type | the new value of the "pack-type" child property |
:SetHomogeneous(self @ T, homogeneous @ Std.Symbol.T) : Std.Object.T
Sets the "homogeneous" property of box, controlling whether or not all children of box are given equal space in the box.
box | a T |
homogeneous | a boolean value, TRUE to create equal allotments, FALSE for variable allotments |