Adw.ExpanderRow

g Adw.ExpanderRow Adw.ExpanderRow Adw.PreferencesRow Adw.PreferencesRow Adw.PreferencesRow->Adw.ExpanderRow GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable 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.ListBoxRow Gtk.ListBoxRow Gtk.Actionable->Gtk.ListBoxRow Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.ListBoxRow->Adw.PreferencesRow Gtk.Widget->Gtk.ListBoxRow

Subclasses:

None

Methods

Inherited:

Adw.PreferencesRow (9), Gtk.ListBoxRow (12), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.Actionable (5)

Structs:

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

class

new ()

add_action (widget)

add_prefix (widget)

add_row (child)

add_suffix (widget)

get_enable_expansion ()

get_expanded ()

get_icon_name ()

get_show_enable_switch ()

get_subtitle ()

get_subtitle_lines ()

get_title_lines ()

remove (child)

set_enable_expansion (enable_expansion)

set_expanded (expanded)

set_icon_name (icon_name)

set_show_enable_switch (show_enable_switch)

set_subtitle (subtitle)

set_subtitle_lines (subtitle_lines)

set_title_lines (title_lines)

Virtual Methods

Inherited:

Gtk.ListBoxRow (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9), Gtk.Actionable (4)

Properties

Inherited:

Adw.PreferencesRow (4), Gtk.ListBoxRow (3), Gtk.Widget (34), Gtk.Accessible (1), Gtk.Actionable (2)

Name

Type

Flags

Short Description

enable-expansion

bool

r/w/en

expanded

bool

r/w/en

icon-name

str

r/w/en

deprecated

show-enable-switch

bool

r/w/en

subtitle

str

r/w/en

subtitle-lines

int

r/w/en

title-lines

int

r/w/en

Signals

Inherited:

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

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

Adw.PreferencesRow

r

Class Details

class Adw.ExpanderRow(**kwargs)
Bases:

Adw.PreferencesRow

Abstract:

No

Structure:

Adw.ExpanderRowClass

A [class`Gtk`.ListBoxRow] used to reveal widgets.

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

The AdwExpanderRow widget allows the user to reveal or hide widgets below it. It also allows the user to enable the expansion of the row, allowing to disable all that the row contains.

Adw.ExpanderRow as Gtk.Buildable

The AdwExpanderRow implementation of the [iface`Gtk`.Buildable] interface supports adding a child as an suffix widget by specifying “suffix” as the “type” attribute of a <child> element.

It also supports adding it as a prefix widget by specifying “prefix” as the “type” attribute of a <child> element.

CSS nodes

AdwExpanderRow has a main CSS node with name row and the .expander style class. It has the .empty style class when it contains no children.

It contains the subnodes row.header for its main embedded row, list.nested for the list it can expand, and image.expander-row-arrow for its arrow.

classmethod new()
Returns:

the newly created AdwExpanderRow

Return type:

Gtk.Widget

Creates a new AdwExpanderRow.

add_action(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds an action widget to self.

Deprecated since version 1.4: Use [method`ExpanderRow`.add_suffix] to add a suffix.

add_prefix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds a prefix widget to self.

add_row(child)
Parameters:

child (Gtk.Widget) – a widget

Adds a widget to self.

The widget will appear in the expanding list below self.

add_suffix(widget)
Parameters:

widget (Gtk.Widget) – a widget

Adds an suffix widget to self.

New in version 1.4.

get_enable_expansion()
Returns:

whether the expansion of self is enabled.

Return type:

bool

Gets whether the expansion of self is enabled.

get_expanded()
Returns:

whether self is expanded

Return type:

bool

Gets whether self is expanded.

get_icon_name()
Returns:

the icon name for self

Return type:

str or None

Gets the icon name for self.

Deprecated since version 1.3: Use [method`ExpanderRow`.add_prefix] to add an icon.

get_show_enable_switch()
Returns:

whether the switch enabling the expansion is visible

Return type:

bool

Gets whether the switch enabling the expansion of self is visible.

get_subtitle()
Returns:

the subtitle for self

Return type:

str

Gets the subtitle for self.

get_subtitle_lines()
Returns:

the number of lines at the end of which the subtitle label will be ellipsized

Return type:

int

Gets the number of lines at the end of which the subtitle label will be ellipsized.

New in version 1.3.

get_title_lines()
Returns:

the number of lines at the end of which the title label will be ellipsized

Return type:

int

Gets the number of lines at the end of which the title label will be ellipsized.

New in version 1.3.

remove(child)
Parameters:

child (Gtk.Widget) – the child to be removed

Removes a child from self.

set_enable_expansion(enable_expansion)
Parameters:

enable_expansion (bool) – whether to enable the expansion

Sets whether the expansion of self is enabled.

set_expanded(expanded)
Parameters:

expanded (bool) – whether to expand the row

Sets whether self is expanded.

set_icon_name(icon_name)
Parameters:

icon_name (str or None) – the icon name

Sets the icon name for self.

Deprecated since version 1.3: Use [method`ExpanderRow`.add_prefix] to add an icon.

set_show_enable_switch(show_enable_switch)
Parameters:

show_enable_switch (bool) – whether to show the switch enabling the expansion

Sets whether the switch enabling the expansion of self is visible.

set_subtitle(subtitle)
Parameters:

subtitle (str) – the subtitle

Sets the subtitle for self.

The subtitle is interpreted as Pango markup unless [property`PreferencesRow`:py:data::use-markup<Adw.ExpanderRow.props.use_markup>] is set to FALSE.

set_subtitle_lines(subtitle_lines)
Parameters:

subtitle_lines (int) – the number of lines at the end of which the subtitle label will be ellipsized

Sets the number of lines at the end of which the subtitle label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

New in version 1.3.

set_title_lines(title_lines)
Parameters:

title_lines (int) – the number of lines at the end of which the title label will be ellipsized

Sets the number of lines at the end of which the title label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

New in version 1.3.

Property Details

Adw.ExpanderRow.props.enable_expansion
Name:

enable-expansion

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether expansion is enabled.

Adw.ExpanderRow.props.expanded
Name:

expanded

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the row is expanded.

Adw.ExpanderRow.props.icon_name
Name:

icon-name

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The icon name for this row.

Deprecated since version 1.3: Use [method`ExpanderRow`.add_prefix] to add an icon.

Adw.ExpanderRow.props.show_enable_switch
Name:

show-enable-switch

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the switch enabling the expansion is visible.

Adw.ExpanderRow.props.subtitle
Name:

subtitle

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The subtitle for this row.

The subtitle is interpreted as Pango markup unless [property`PreferencesRow`:py:data::use-markup<Adw.ExpanderRow.props.use_markup>] is set to FALSE.

Adw.ExpanderRow.props.subtitle_lines
Name:

subtitle-lines

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The number of lines at the end of which the subtitle label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

New in version 1.3.

Adw.ExpanderRow.props.title_lines
Name:

title-lines

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The number of lines at the end of which the title label will be ellipsized.

If the value is 0, the number of lines won’t be limited.

New in version 1.3.