PreferencesGroup#

class PreferencesGroup(**properties: Any)#

Superclasses: Widget, InitiallyUnowned, Object

Implemented Interfaces: Accessible, Buildable, ConstraintTarget

A group of preference rows.

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 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 PreferencesDialog to let the user look for a preference.

The separate_rows property can be used to separate the rows within the group, same as when using the `.boxed-list-separate <style-classes.html#boxed-lists-cards>`__ style class instead of .boxed-list.

AdwPreferencesGroup as GtkBuildable#

The AdwPreferencesGroup implementation of the Buildable interface supports adding PreferencesRows to the list by omitting “type”. If “type” is omitted and the widget isn’t a 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#

class PreferencesGroup
classmethod new() Widget#

Creates a new AdwPreferencesGroup.

Methods#

class PreferencesGroup
add(child: Widget) None#

Adds a child to self.

Parameters:

child – the widget to add

get_description() str | None#

Gets the description of self.

get_header_suffix() Widget | None#

Gets the suffix for self's header.

Added in version 1.1.

get_separate_rows() bool#

Gets whether self's rows are separated.

Added in version 1.6.

get_title() str#

Gets the title of self.

remove(child: Widget) None#

Removes a child from self.

Parameters:

child – the child to remove

set_description(description: str | None = None) None#

Sets the description for self.

Parameters:

description – the description

set_header_suffix(suffix: 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.

Added in version 1.1.

Parameters:

suffix – the suffix to set

set_separate_rows(separate_rows: bool) None#

Sets whether self's rows are separated.

Equivalent to using the `.boxed-list-separate <style-classes.html#boxed-lists-cards>`__ style class on a ListBox instead of .boxed-list.

Added in version 1.6.

Parameters:

separate_rows – whether to separate rows

set_title(title: str) None#

Sets the title for self.

Parameters:

title – the title

Properties#

class PreferencesGroup
props.description: str#

The type of the None singleton.

props.header_suffix: Widget#

The type of the None singleton.

Added in version 1.1.

props.separate_rows: bool#

The type of the None singleton.

Added in version 1.6.

props.title: str#

The type of the None singleton.

Fields#

class PreferencesGroup
parent_instance#