CenterBox
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, Buildable
, ConstraintTarget
, Orientable
- Constructors:
CenterBox(**properties)
new() -> Gtk.Widget
Constructors
Methods
- class CenterBox
- get_baseline_position() BaselinePosition
Gets the value set by
set_baseline_position()
.
- get_shrink_center_last() bool
Gets whether
self
shrinks the center widget after other children.Added in version 4.12.
- set_baseline_position(position: BaselinePosition) None
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 wrt. the extra space available.- Parameters:
position – a
GtkBaselinePosition
- set_center_widget(child: Widget | None = None) None
Sets the center widget.
To remove the existing center widget, pass
None
.- Parameters:
child – the new center widget
- set_end_widget(child: Widget | None = None) None
Sets the end widget.
To remove the existing end widget, pass
None
.- Parameters:
child – the new end widget
- set_shrink_center_last(shrink_center_last: bool) None
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 set to
FALSE
, start and end widgets keep natural width and the center widget starts shrinking instead.Added in version 4.12.
- Parameters:
shrink_center_last – whether to shrink the center widget after others
Properties
- class CenterBox
- props.baseline_position: BaselinePosition
The position of the baseline aligned widget if extra space is available.
- props.center_widget: Widget
The widget that is placed at the center position.
Added in version 4.10.
- props.end_widget: Widget
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 wrt. to the text direction.
Added in version 4.10.
- props.shrink_center_last: bool
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 set to
FALSE
, start and end widgets keep natural width and the center widget starts shrinking instead.Added in version 4.12.