:right-sidebar: True CenterLayout =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: CenterLayout(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.LayoutManager`, :class:`~gi.repository.GObject.Object` ``GtkCenterLayout`` is a layout manager that manages up to three children. The start widget is allocated at the start of the layout (left in left-to-right locales and right in right-to-left ones), and the end widget at the end. The center widget is centered regarding the full width of the layout's. Constructors ------------ .. rst-class:: interim-class .. class:: CenterLayout :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.LayoutManager Creates a new ``GtkCenterLayout``. Methods ------- .. rst-class:: interim-class .. class:: CenterLayout :no-index: .. method:: get_baseline_position() -> ~gi.repository.Gtk.BaselinePosition Returns the baseline position of the layout. .. method:: get_center_widget() -> ~gi.repository.Gtk.Widget | None Returns the center widget of the layout. .. method:: get_end_widget() -> ~gi.repository.Gtk.Widget | None Returns the end widget of the layout. .. method:: get_orientation() -> ~gi.repository.Gtk.Orientation Gets the current orienration of the layout manager. .. method:: get_shrink_center_last() -> bool Gets whether ``self`` shrinks the center widget after other children. .. versionadded:: 4.12 .. method:: get_start_widget() -> ~gi.repository.Gtk.Widget | None Returns the start widget of the layout. .. method:: set_baseline_position(baseline_position: ~gi.repository.Gtk.BaselinePosition) -> None Sets the new baseline position of ``self`` :param baseline_position: the new baseline position .. method:: set_center_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the new center widget of ``self``. To remove the existing center widget, pass :const:`None`. :param widget: the new center widget .. method:: set_end_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the new end widget of ``self``. To remove the existing center widget, pass :const:`None`. :param widget: the new end widget .. method:: set_orientation(orientation: ~gi.repository.Gtk.Orientation) -> None Sets the orientation of ``self``. :param orientation: the new orientation .. method:: 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. .. versionadded:: 4.12 :param shrink_center_last: whether to shrink the center widget after others .. method:: set_start_widget(widget: ~gi.repository.Gtk.Widget | None = None) -> None Sets the new start widget of ``self``. To remove the existing start widget, pass :const:`None`. :param widget: the new start widget Properties ---------- .. rst-class:: interim-class .. class:: CenterLayout :no-index: .. attribute:: props.shrink_center_last :type: 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. .. versionadded:: 4.12