gtk.box
Module for [Box] class
Types 3
The GtkBox widget arranges child widgets into a single row or column, depending upon the value of its #GtkOrientable:orientation property. Within the other dimension, all children are allocated the same size. Of course, the #GtkWidget:halign and #GtkWidget:valign properties can be used on the children to influence their allocation.
GtkBox uses a notion of packing. Packing refers to adding widgets with reference to a particular position in a #GtkContainer. For a GtkBox, there are two reference positions: the start and the end of the box. For a vertical #GtkBox, the start is defined as the top of the box and the end is defined as the bottom. For a horizontal #GtkBox the start is defined as the left side and the end is defined as the right side.
Use repeated calls to [gtk.box.Box.packStart] to pack widgets into a GtkBox from start to end. Use [gtk.box.Box.packEnd] 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 #GtkContainer, you may also use [gtk.container.Container.add] to insert widgets into the box, and they will be packed with the default values for expand and fill child properties. Use [gtk.container.Container.remove] to remove widgets from the GtkBox.
Use [gtk.box.Box.setHomogeneous] to specify whether or not all children of the GtkBox are forced to get the same amount of space.
Use [gtk.box.Box.setSpacing] 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.Box.packStart] or [gtk.box.Box.packEnd] is added on either side of the widget it belongs to.
Use [gtk.box.Box.reorderChild] to move a GtkBox child to a different place in the box.
Use [gtk.box.Box.setChildPacking] to reset the expand, fill and padding child properties. Use [gtk.box.Box.queryChildPacking] to query these fields.
CSS nodes
GtkBox uses a single CSS node with name box.
In horizontal orientation, the nodes of the children are always arranged from left to right. So :first-child will always select the leftmost child, regardless of text direction.
BoxGidBuilder builder()Get builder for [gtk.box.Box] Returns: New builder objectgtk.types.BaselinePosition baselinePosition() @propertyvoid baselinePosition(gtk.types.BaselinePosition propval) @propertybool homogeneous() @propertyvoid homogeneous(bool propval) @propertyint spacing() @propertyvoid spacing(int propval) @propertygtk.types.BaselinePosition getBaselinePosition()Gets the value set by [gtk.box.Box.setBaselinePosition]. Returns: the baseline positiongtk.widget.Widget getCenterWidget()Retrieves the center widget of the box. Returns: the center widget or null in case no center widget is set.bool getHomogeneous()Returns whether the box is homogeneous (all children are the same size). See [gtk.box.Box.setHomogeneous]. Returns: true if the box is homogeneous.int getSpacing()Gets the value set by [gtk.box.Box.setSpacing]. Returns: spacing between childrenvoid packEnd(gtk.widget.Widget child, bool expand, bool fill, uint padding)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.void packStart(gtk.widget.Widget child, bool expand, bool fill, uint padding)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.void queryChildPacking(gtk.widget.Widget child, out bool expand, out bool fill, out uint padding, out gtk.types.PackType packType)Obtains information about how child is packed into box.void reorderChild(gtk.widget.Widget child, int position)Moves child to a new position in the list of box children. The list contains widgets packed #GTKPACKSTART as well as widgets packed #GTKPACKEND, in the order that these widgets were added to box.void setBaselinePosition(gtk.types.BaselinePosition position)Sets the baseline position of a box. This affects only horizontal boxes with at least one baseline aligned child. If there is more vertical space available than requested, and the baseline is not a...void setCenterWidget(gtk.widget.Widget widget = null)Sets a center widget; that is a child widget that will be centered with respect to the full width of the box, even if the children at either side take up different amounts of space.void setChildPacking(gtk.widget.Widget child, bool expand, bool fill, uint padding, gtk.types.PackType packType)Sets the way child is packed into box.void setHomogeneous(bool homogeneous)Sets the #GtkBox:homogeneous property of box, controlling whether or not all children of box are given equal space in the box.void setSpacing(int spacing)Sets the #GtkBox:spacing property of box, which is the number of pixels to place between children of box.this(gtk.types.Orientation orientation, int spacing)Creates a new #GtkBox.T baselinePosition(gtk.types.BaselinePosition propval)T homogeneous(bool propval)T spacing(int propval)