It derives from <GtkWidget>.
Arranges three children in a row, keeping the middle child centered as well as possible.
To add children to <GtkCenterBox>, use
center-box:set-start-widget,
center-box:set-center-widget
and center-box:set-end-widget.
The sizing and positioning of children can be influenced with the align and expand properties of the children.
The <GtkCenterBox> implementation of the
<GtkBuildable> interface supports placing
children in the 3 positions by specifying “start”, “center” or “end” as
the “type” attribute of a <child> element.
<GtkCenterBox> uses a single CSS node with the
name “box”,
The first child of the <GtkCenterBox> 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.
Until GTK 4.10, <GtkCenterBox> used the
Gtk.AccessibleRole.group role.
Starting from GTK 4.12, <GtkCenterBox> uses the
Gtk.AccessibleRole.generic role.
The position of the baseline aligned widget if extra space is available.
Its value is a <GtkBaselinePosition> (or,
to set it, one of its symbols).
Set it with (set! (center-box:baseline-position self) value).
The widget that is placed at the center position.
Its value is a <GtkWidget>, or #f.
Set it with (set! (center-box:center-widget self) value).
The widget that is placed at the end position.
In vertical orientation, the end position is at the bottom. In horizontal orientation, the end position is at the trailing edge with respect to the text direction.
Its value is a <GtkWidget>, or #f.
Set it with (set! (center-box:end-widget self) value).
Whether to shrink the center widget after other children.
By default, when there’s no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.
If false, start and end widgets keep natural width and the center widget starts shrinking instead.
Its value is a boolean.
Set it with (set! (center-box:shrink-center-last self) value).
The widget that is placed at the start position.
In vertical orientation, the start position is at the top. In horizontal orientation, the start position is at the leading edge with respect to the text direction.
Its value is a <GtkWidget>, or #f.
Set it with (set! (center-box:start-widget self) value).
Gets the baseline position of the center box.
See center-box:set-baseline-position.
Passed: a <GtkCenterBox>.
a center box
Returned: a <GtkBaselinePosition>.
the baseline position
Gets the center widget.
Passed: a <GtkCenterBox>.
a center box
Returned: a <GtkWidget>, or #f.
the center widget
Gets the end widget.
Passed: a <GtkCenterBox>.
a center box
Returned: a <GtkWidget>, or #f.
the end widget
Gets whether the center widget shrinks after other children.
Passed: a <GtkCenterBox>.
a center box
Returned: a boolean.
whether to shrink the center widget after others
Gets the start widget.
Passed: a <GtkCenterBox>.
a center box
Returned: a <GtkWidget>, or #f.
the start widget
Creates a new <GtkCenterBox>.
Returned: a <GtkWidget>.
the new <GtkCenterBox>
Sets the baseline position of a center 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 allocated by the parent then position is used to allocate the baseline with respect to the extra space available.
Passed: a <GtkCenterBox>.
a center box
Passed: a <GtkBaselinePosition>, or one
of its symbols.
the baseline position
Sets the center widget.
To remove the existing center widget, pass NULL.
Passed: a <GtkCenterBox>.
a center box
Passed, or left out: a <GtkWidget>, or #f.
the new center widget
Sets the end widget.
To remove the existing end widget, pass NULL.
Passed: a <GtkCenterBox>.
a center box
Passed, or left out: a <GtkWidget>, or #f.
the new end widget
Sets whether to shrink the center widget after other children.
By default, when there’s no space to give all three children their natural widths, the start and end widgets start shrinking and the center child keeps natural width until they reach minimum width.
If shrink-center-last is false, start and end widgets keep natural width and the center widget starts shrinking instead.
Passed: a <GtkCenterBox>.
a cener box
Passed: a boolean.
whether to shrink the center widget after others
Sets the start widget.
To remove the existing start widget, pass NULL.
Passed: a <GtkCenterBox>.
a center box
Passed, or left out: a <GtkWidget>, or #f.
the new start widget