:right-sidebar: True PreferencesGroup =================================================================== .. currentmodule:: gi.repository.Adw .. class:: PreferencesGroup(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A group of preference rows. .. image:: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/preferences-group.png An ``AdwPreferencesGroup`` represents a group or tightly related preferences, which in turn are represented by :obj:`~gi.repository.Adw.PreferencesRow`\. To summarize the role of the preferences it gathers, a group can have both a title and a description. The title will be used by :obj:`~gi.repository.Adw.PreferencesDialog` to let the user look for a preference. The :obj:`~gi.repository.Adw.PreferencesGroup.props.separate_rows` property can be used to separate the rows within the group, same as when using the ```.boxed-list-separate`` `__ style class instead of ``.boxed-list``\. AdwPreferencesGroup as GtkBuildable -------------------------------------------------------------------------------- The ``AdwPreferencesGroup`` implementation of the :obj:`~gi.repository.Gtk.Buildable` interface supports adding :obj:`~gi.repository.Adw.PreferencesRow`\s to the list by omitting "type". If "type" is omitted and the widget isn't a :obj:`~gi.repository.Adw.PreferencesRow` the child is added to a box below the list. When the "type" attribute of a child is ``header-suffix``\, the child is set as the suffix on the end of the title and description. CSS nodes -------------------------------------------------------------------------------- ``AdwPreferencesGroup`` has a single CSS node with name ``preferencesgroup``\. Accessibility -------------------------------------------------------------------------------- ``AdwPreferencesGroup`` uses the :obj:`~gi.repository.Gtk.AccessibleRole.group` role. Constructors ------------ .. rst-class:: interim-class .. class:: PreferencesGroup :no-index: .. classmethod:: new() -> ~gi.repository.Gtk.Widget Creates a new ``AdwPreferencesGroup``\. Methods ------- .. rst-class:: interim-class .. class:: PreferencesGroup :no-index: .. method:: add(child: ~gi.repository.Gtk.Widget) -> None Adds a child to ``self``\. :param child: the widget to add .. method:: bind_model(model: ~gi.repository.Gio.ListModel | None = None, create_row_func: ~collections.abc.Callable[[~gi.repository.GObject.Object, ~typing.Any], ~gi.repository.Gtk.Widget] | None = None, user_data: ~typing.Any = None) -> None Binds ``model`` to ``self``\. See :obj:`~gi.repository.Gtk.ListBox.bind_model`\. .. versionadded:: 1.8 :param model: a list model to bind :param create_row_func: a function creating a row for each item, or ``NULL`` in case ``model`` is ``NULL`` :param user_data: user data passed to ``create_row_func`` .. method:: get_description() -> str | None Gets the description of ``self``\. .. method:: get_header_suffix() -> ~gi.repository.Gtk.Widget | None Gets the suffix for ``self``\'s header. .. versionadded:: 1.1 .. method:: get_row(index: int) -> ~gi.repository.Gtk.Widget | None Gets the row at ``index``\. Can return ``NULL`` if ``index`` is larger than the number of rows in the group. .. versionadded:: 1.8 :param index: a row index .. method:: get_separate_rows() -> bool Gets whether ``self``\'s rows are separated. .. versionadded:: 1.6 .. method:: get_title() -> str Gets the title of ``self``\. .. method:: remove(child: ~gi.repository.Gtk.Widget) -> None Removes a child from ``self``\. :param child: the child to remove .. method:: set_description(description: str | None = None) -> None Sets the description for ``self``\. :param description: the description .. method:: set_header_suffix(suffix: ~gi.repository.Gtk.Widget | None = None) -> None Sets the suffix for ``self``\'s header. Displayed above the list, next to the title and description. Suffixes are commonly used to show a button or a spinner for the whole group. .. versionadded:: 1.1 :param suffix: the suffix to set .. method:: set_separate_rows(separate_rows: bool) -> None Sets whether ``self``\'s rows are separated. Equivalent to using the ```.boxed-list-separate`` `__ style class on a :obj:`~gi.repository.Gtk.ListBox` instead of ``.boxed-list``\. .. versionadded:: 1.6 :param separate_rows: whether to separate rows .. method:: set_title(title: str) -> None Sets the title for ``self``\. :param title: the title Properties ---------- .. rst-class:: interim-class .. class:: PreferencesGroup :no-index: .. attribute:: props.description :type: str The description for this group of preferences. .. attribute:: props.header_suffix :type: ~gi.repository.Gtk.Widget The header suffix widget. Displayed above the list, next to the title and description. Suffixes are commonly used to show a button or a spinner for the whole group. .. versionadded:: 1.1 .. attribute:: props.separate_rows :type: bool Whether to separate rows. Equivalent to using the ```.boxed-list-separate`` `__ style class on a :obj:`~gi.repository.Gtk.ListBox` instead of ``.boxed-list``\. .. versionadded:: 1.6 .. attribute:: props.title :type: str The title for this group of preferences. Fields ------ .. rst-class:: interim-class .. class:: PreferencesGroup :no-index: .. attribute:: parent_instance