gtk.box
Module for [Box] class
Types 3
The gtk.box.Box widget arranges child widgets into a single row or column.
Whether it is a row or column depends on the value of its gtk.orientable.Orientable.orientation property. Within the other dimension, all children are allocated the same size. Of course, the gtk.widget.Widget.halign and gtk.widget.Widget.valign properties can be used on the children to influence their allocation.
Use repeated calls to gtk.box.Box.append to pack widgets into a gtk.box.Box from start to end. Use gtk.box.Box.remove to remove widgets from the gtk.box.Box. gtk.box.Box.insertChildAfter can be used to add a child at a particular position.
Use gtk.box.Box.setHomogeneous to specify whether or not all children of the gtk.box.Box 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 gtk.box.Box. Note that spacing is added between the children.
Use gtk.box.Box.reorderChildAfter to move a child to a different place in the box.
CSS nodes
gtk.box.Box uses a single CSS node with name box.
Accessibility
Until GTK 4.10, gtk.box.Box used the gtk.types.AccessibleRole.Group role.
Starting from GTK 4.12, gtk.box.Box uses the gtk.types.AccessibleRole.Generic role.
int baselineChild() @property nothrowGet `baselineChild` property. Returns: The child that determines the baseline, in vertical orientation.void baselineChild(int propval) @property nothrowSet `baselineChild` property. Params: propval = The child that determines the baseline, in vertical orientation.gtk.types.BaselinePosition baselinePosition() @property nothrowGet `baselinePosition` property. Returns: The position of the baseline aligned widgets if extra space is available.void baselinePosition(gtk.types.BaselinePosition propval) @property nothrowSet `baselinePosition` property. Params: propval = The position of the baseline aligned widgets if extra space is available.bool homogeneous() @property nothrowGet `homogeneous` property. Returns: Whether the children should all be the same size.void homogeneous(bool propval) @property nothrowSet `homogeneous` property. Params: propval = Whether the children should all be the same size.int spacing() @property nothrowGet `spacing` property. Returns: The amount of space between children.void spacing(int propval) @property nothrowSet `spacing` property. Params: propval = The amount of space between children.int getBaselineChild() nothrowGets the value set by [gtk.box.Box.setBaselineChild]. Returns: the baseline childgtk.types.BaselinePosition getBaselinePosition() nothrowGets the value set by [gtk.box.Box.setBaselinePosition]. Returns: the baseline positionbool getHomogeneous() nothrowReturns whether the box is homogeneous (all children are the same size). Returns: true if the box is homogeneous.int getSpacing() nothrowGets the value set by [gtk.box.Box.setSpacing]. Returns: spacing between childrenvoid insertChildAfter(gtk.widget.Widget child, gtk.widget.Widget sibling = null) nothrowInserts child in the position after sibling in the list of box children.void reorderChildAfter(gtk.widget.Widget child, gtk.widget.Widget sibling = null) nothrowMoves child to the position after sibling in the list of box children.void setBaselinePosition(gtk.types.BaselinePosition position) nothrowSets the baseline position of a box.void setHomogeneous(bool homogeneous) nothrowSets whether or not all children of box are given equal space in the box.this(gtk.types.Orientation orientation, int spacing)Creates a new [gtk.box.Box].Fluent builder implementation template for gtk.box.Box
T baselineChild(int propval) nothrowSet `baselineChild` property. Params: propval = The child that determines the baseline, in vertical orientation. Returns: Builder instance for fluent chainingT baselinePosition(gtk.types.BaselinePosition propval) nothrowSet `baselinePosition` property. Params: propval = The position of the baseline aligned widgets if extra space is available. Returns: Builder instance for fluent chainingT homogeneous(bool propval) nothrowSet `homogeneous` property. Params: propval = Whether the children should all be the same size. Returns: Builder instance for fluent chainingT spacing(int propval) nothrowSet `spacing` property. Params: propval = The amount of space between children. Returns: Builder instance for fluent chainingFluent builder for gtk.box.Box