:right-sidebar: True LayoutManager =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: LayoutManager(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Subclasses: :class:`~gi.repository.Gtk.BinLayout`, :class:`~gi.repository.Gtk.BoxLayout`, :class:`~gi.repository.Gtk.CenterLayout`, :class:`~gi.repository.Gtk.ConstraintLayout`, :class:`~gi.repository.Gtk.CustomLayout`, :class:`~gi.repository.Gtk.FixedLayout`, :class:`~gi.repository.Gtk.GridLayout`, :class:`~gi.repository.Gtk.OverlayLayout` :Constructors: :: LayoutManager(**properties) Methods ------- .. rst-class:: interim-class .. class:: LayoutManager :no-index: .. method:: allocate(widget: ~gi.repository.Gtk.Widget, width: int, height: int, baseline: int) -> None Assigns the given ``width``, ``height``, and ``baseline`` to a ``widget``, and computes the position and sizes of the children of the ``widget`` using the layout management policy of ``manager``. :param widget: the ``GtkWidget`` using ``manager`` :param width: the new width of the ``widget`` :param height: the new height of the ``widget`` :param baseline: the baseline position of the ``widget``, or -1 .. method:: get_layout_child(child: ~gi.repository.Gtk.Widget) -> ~gi.repository.Gtk.LayoutChild Retrieves a ``GtkLayoutChild`` instance for the ``GtkLayoutManager``, creating one if necessary. The ``child`` widget must be a child of the widget using ``manager``. The ``GtkLayoutChild`` instance is owned by the ``GtkLayoutManager``, and is guaranteed to exist as long as ``child`` is a child of the ``GtkWidget`` using the given ``GtkLayoutManager``. :param child: a ``GtkWidget`` .. method:: get_request_mode() -> ~gi.repository.Gtk.SizeRequestMode Retrieves the request mode of ``manager``. .. method:: get_widget() -> ~gi.repository.Gtk.Widget | None Retrieves the ``GtkWidget`` using the given ``GtkLayoutManager``. .. method:: layout_changed() -> None Queues a resize on the ``GtkWidget`` using ``manager``, if any. This function should be called by subclasses of ``GtkLayoutManager`` in response to changes to their layout management policies. .. method:: measure(widget: ~gi.repository.Gtk.Widget, orientation: ~gi.repository.Gtk.Orientation, for_size: int) -> tuple[int, int, int, int] Measures the size of the ``widget`` using ``manager``, for the given ``orientation`` and size. See the :obj:`~gi.repository.Gtk.Widget` documentation on layout management for more details. :param widget: the ``GtkWidget`` using ``manager`` :param orientation: the orientation to measure :param for_size: Size for the opposite of ``orientation``; for instance, if the ``orientation`` is :const:`~gi.repository.Gtk.Orientation.HORIZONTAL`, this is the height of the widget; if the ``orientation`` is :const:`~gi.repository.Gtk.Orientation.VERTICAL`, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not known Virtual Methods --------------- .. rst-class:: interim-class .. class:: LayoutManager :no-index: .. method:: do_allocate(widget: ~gi.repository.Gtk.Widget, width: int, height: int, baseline: int) -> None Assigns the given ``width``, ``height``, and ``baseline`` to a ``widget``, and computes the position and sizes of the children of the ``widget`` using the layout management policy of ``manager``. :param widget: the ``GtkWidget`` using ``manager`` :param width: the new width of the ``widget`` :param height: the new height of the ``widget`` :param baseline: the baseline position of the ``widget``, or -1 .. method:: do_create_layout_child(widget: ~gi.repository.Gtk.Widget, for_child: ~gi.repository.Gtk.Widget) -> ~gi.repository.Gtk.LayoutChild Create a ``GtkLayoutChild`` instance for the given ``for_child`` widget. :param widget: the widget using the ``manager`` :param for_child: the child of ``widget`` .. method:: do_get_request_mode(widget: ~gi.repository.Gtk.Widget) -> ~gi.repository.Gtk.SizeRequestMode a virtual function, used to return the preferred request mode for the layout manager; for instance, "width for height" or "height for width"; see ``GtkSizeRequestMode`` :param widget: .. method:: do_measure(widget: ~gi.repository.Gtk.Widget, orientation: ~gi.repository.Gtk.Orientation, for_size: int) -> tuple[int, int, int, int] Measures the size of the ``widget`` using ``manager``, for the given ``orientation`` and size. See the :obj:`~gi.repository.Gtk.Widget` documentation on layout management for more details. :param widget: the ``GtkWidget`` using ``manager`` :param orientation: the orientation to measure :param for_size: Size for the opposite of ``orientation``; for instance, if the ``orientation`` is :const:`~gi.repository.Gtk.Orientation.HORIZONTAL`, this is the height of the widget; if the ``orientation`` is :const:`~gi.repository.Gtk.Orientation.VERTICAL`, this is the width of the widget. This allows to measure the height for the given width, and the width for the given height. Use -1 if the size is not known .. method:: do_root() -> None a virtual function, called when the widget using the layout manager is attached to a ``GtkRoot`` .. method:: do_unroot() -> None a virtual function, called when the widget using the layout manager is detached from a ``GtkRoot`` Fields ------ .. rst-class:: interim-class .. class:: LayoutManager :no-index: .. attribute:: parent_instance