: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 ``GTK_ACCESSIBLE_ROLE_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:: 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_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 type of the None singleton. .. attribute:: props.header_suffix :type: ~gi.repository.Gtk.Widget The type of the None singleton. .. versionadded:: 1.1 .. attribute:: props.separate_rows :type: bool The type of the None singleton. .. versionadded:: 1.6 .. attribute:: props.title :type: str The type of the None singleton. Fields ------ .. rst-class:: interim-class .. class:: PreferencesGroup :no-index: .. attribute:: parent_instance