gtk.center_box

Module for [CenterBox] class

Types 3

gtk.center_box.CenterBox arranges three children in a row, keeping the middle child centered as well as possible.

!An example GtkCenterBox

To add children to gtk.center_box.CenterBox, use gtk.center_box.CenterBox.setStartWidget, gtk.center_box.CenterBox.setCenterWidget and gtk.center_box.CenterBox.setEndWidget.

The sizing and positioning of children can be influenced with the align and expand properties of the children.

GtkCenterBox as GtkBuildable

The gtk.center_box.CenterBox implementation of the gtk.buildable.Buildable interface supports placing children in the 3 positions by specifying “start”, “center” or “end” as the “type” attribute of a <child> element.

CSS nodes

gtk.center_box.CenterBox uses a single CSS node with the name “box”,

The first child of the gtk.center_box.CenterBox will be allocated depending on the text direction, i.e. in left-to-right layouts it will be allocated on the left and in right-to-left layouts on the right.

In vertical orientation, the nodes of the children are arranged from top to bottom.

Accessibility

Until GTK 4.10, gtk.center_box.CenterBox used the gtk.types.AccessibleRole.Group role.

Starting from GTK 4.12, gtk.center_box.CenterBox uses the gtk.types.AccessibleRole.Generic role.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
CenterBox self() nothrowReturns `this`, for use in `with` statements.
CenterBoxGidBuilder builder() static nothrowGet builder for [gtk.center_box.CenterBox] Returns: New builder object
gtk.types.BaselinePosition baselinePosition() @property nothrowGet `baselinePosition` property. Returns: The position of the baseline aligned widget if extra space is available.
void baselinePosition(gtk.types.BaselinePosition propval) @property nothrowSet `baselinePosition` property. Params: propval = The position of the baseline aligned widget if extra space is available.
gtk.widget.Widget centerWidget() @property nothrowGet `centerWidget` property. Returns: The widget that is placed at the center position.
void centerWidget(gtk.widget.Widget propval) @property nothrowSet `centerWidget` property. Params: propval = The widget that is placed at the center position.
gtk.widget.Widget endWidget() @property nothrowGet `endWidget` property. Returns: The widget that is placed at the end position.
void endWidget(gtk.widget.Widget propval) @property nothrowSet `endWidget` property. Params: propval = The widget that is placed at the end position.
bool shrinkCenterLast() @property nothrowGet `shrinkCenterLast` property. Returns: Whether to shrink the center widget after other children.
void shrinkCenterLast(bool propval) @property nothrowSet `shrinkCenterLast` property. Params: propval = Whether to shrink the center widget after other children.
gtk.widget.Widget startWidget() @property nothrowGet `startWidget` property. Returns: The widget that is placed at the start position.
void startWidget(gtk.widget.Widget propval) @property nothrowSet `startWidget` property. Params: propval = The widget that is placed at the start position.
gtk.types.BaselinePosition getBaselinePosition() nothrowGets the value set by [gtk.center_box.CenterBox.setBaselinePosition]. Returns: the baseline position
gtk.widget.Widget getCenterWidget() nothrowGets the center widget, or null if there is none. Returns: the center widget.
gtk.widget.Widget getEndWidget() nothrowGets the end widget, or null if there is none. Returns: the end widget.
bool getShrinkCenterLast() nothrowGets whether self shrinks the center widget after other children. Returns: whether to shrink the center widget after others
gtk.widget.Widget getStartWidget() nothrowGets the start widget, or null if there is none. Returns: the start widget.
void setBaselinePosition(gtk.types.BaselinePosition position) nothrowSets the baseline position of a center box.
void setCenterWidget(gtk.widget.Widget child = null) nothrowSets the center widget.
void setEndWidget(gtk.widget.Widget child = null) nothrowSets the end widget.
void setShrinkCenterLast(bool shrinkCenterLast) nothrowSets whether to shrink the center widget after other children.
void setStartWidget(gtk.widget.Widget child = null) nothrowSets the start widget.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new [gtk.center_box.CenterBox]. Returns: the new [gtk.center_box.CenterBox].

Fluent builder implementation template for gtk.center_box.CenterBox

Methods
T baselinePosition(gtk.types.BaselinePosition propval) nothrowSet `baselinePosition` property. Params: propval = The position of the baseline aligned widget if extra space is available. Returns: Builder instance for fluent chaining
T centerWidget(gtk.widget.Widget propval) nothrowSet `centerWidget` property. Params: propval = The widget that is placed at the center position. Returns: Builder instance for fluent chaining
T endWidget(gtk.widget.Widget propval) nothrowSet `endWidget` property. Params: propval = The widget that is placed at the end position.
T shrinkCenterLast(bool propval) nothrowSet `shrinkCenterLast` property. Params: propval = Whether to shrink the center widget after other children.
T startWidget(gtk.widget.Widget propval) nothrowSet `startWidget` property. Params: propval = The widget that is placed at the start position.

Fluent builder for gtk.center_box.CenterBox

Methods
CenterBox build() nothrowCreate object from builder. Returns: New object