:right-sidebar: True SizeGroup =================================================================== .. currentmodule:: gi.repository.Gtk .. class:: SizeGroup(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Buildable` :Constructors: :: SizeGroup(**properties) new(mode:Gtk.SizeGroupMode) -> Gtk.SizeGroup Constructors ------------ .. rst-class:: interim-class .. class:: SizeGroup :no-index: .. classmethod:: new(mode: ~gi.repository.Gtk.SizeGroupMode) -> ~gi.repository.Gtk.SizeGroup Create a new ``GtkSizeGroup``. :param mode: the mode for the new size group. Methods ------- .. rst-class:: interim-class .. class:: SizeGroup :no-index: .. method:: add_widget(widget: ~gi.repository.Gtk.Widget) -> None Adds a widget to a ``GtkSizeGroup``. In the future, the requisition of the widget will be determined as the maximum of its requisition and the requisition of the other widgets in the size group. Whether this applies horizontally, vertically, or in both directions depends on the mode of the size group. See :obj:`~gi.repository.Gtk.SizeGroup.set_mode`. When the widget is destroyed or no longer referenced elsewhere, it will be removed from the size group. :param widget: the ``GtkWidget`` to add .. method:: get_mode() -> ~gi.repository.Gtk.SizeGroupMode Gets the current mode of the size group. .. method:: get_widgets() -> list[~gi.repository.Gtk.Widget] Returns the list of widgets associated with ``size_group``. .. method:: remove_widget(widget: ~gi.repository.Gtk.Widget) -> None Removes a widget from a ``GtkSizeGroup``. :param widget: the ``GtkWidget`` to remove .. method:: set_mode(mode: ~gi.repository.Gtk.SizeGroupMode) -> None Sets the ``GtkSizeGroupMode`` of the size group. The mode of the size group determines whether the widgets in the size group should all have the same horizontal requisition (:const:`~gi.repository.Gtk.SizeGroupMode.HORIZONTAL`) all have the same vertical requisition (:const:`~gi.repository.Gtk.SizeGroupMode.VERTICAL`), or should all have the same requisition in both directions (:const:`~gi.repository.Gtk.SizeGroupMode.BOTH`). :param mode: the mode to set for the size group. Properties ---------- .. rst-class:: interim-class .. class:: SizeGroup :no-index: .. attribute:: props.mode :type: ~gi.repository.Gtk.SizeGroupMode The direction in which the size group affects requested sizes. Fields ------ .. rst-class:: interim-class .. class:: SizeGroup :no-index: .. attribute:: parent_instance