Adw.PreferencesGroup

g Adw.PreferencesGroup Adw.PreferencesGroup GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Adw.PreferencesGroup

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new ()

add (child)

get_description ()

get_header_suffix ()

get_title ()

remove (child)

set_description (description)

set_header_suffix (suffix)

set_title (title)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

description

str

r/w/en

header-suffix

Gtk.Widget

r/w/en

title

str

r/w/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class Adw.PreferencesGroup(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

Adw.PreferencesGroupClass

A group of preference rows.

<picture> <source srcset=”preferences-group-dark.png” media=”(prefers-color-scheme: dark)”> <img src=”preferences-group.png” alt=”preferences-group”> </picture>

An AdwPreferencesGroup represents a group or tightly related preferences, which in turn are represented by [class`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 [class`PreferencesDialog`] to let the user look for a preference.

Adw.PreferencesGroup as Gtk.Buildable

The AdwPreferencesGroup implementation of the [iface`Gtk`.Buildable] interface supports adding [class`PreferencesRow`]s to the list by omitting “type”. If “type” is omitted and the widget isn’t a [class`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.

classmethod new()
Returns:

the newly created AdwPreferencesGroup

Return type:

Gtk.Widget

Creates a new AdwPreferencesGroup.

add(child)
Parameters:

child (Gtk.Widget) – the widget to add

Adds a child to self.

get_description()
Returns:

the description of self

Return type:

str or None

Gets the description of self.

get_header_suffix()
Returns:

the suffix for self's header.

Return type:

Gtk.Widget or None

Gets the suffix for self's header.

New in version 1.1.

get_title()
Returns:

the title of self

Return type:

str

Gets the title of self.

remove(child)
Parameters:

child (Gtk.Widget) – the child to remove

Removes a child from self.

set_description(description)
Parameters:

description (str or None) – the description

Sets the description for self.

set_header_suffix(suffix)
Parameters:

suffix (Gtk.Widget or None) – the suffix to set

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.

New in version 1.1.

set_title(title)
Parameters:

title (str) – the title

Sets the title for self.

Property Details

Adw.PreferencesGroup.props.description
Name:

description

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The description for this group of preferences.

Adw.PreferencesGroup.props.header_suffix
Name:

header-suffix

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.1.

Adw.PreferencesGroup.props.title
Name:

title

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The title for this group of preferences.