Gtk.ListBoxRow

g 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.Widget->Gtk.ListBoxRow

Subclasses:

None

Methods

Inherited:

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

Structs:

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

class

new ()

changed ()

get_activatable ()

get_child ()

get_header ()

get_index ()

get_selectable ()

is_selected ()

set_activatable (activatable)

set_child (child)

set_header (header)

set_selectable (selectable)

Virtual Methods

Inherited:

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

do_activate ()

Properties

Inherited:

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

Name

Type

Flags

Short Description

activatable

bool

r/w/en

child

Gtk.Widget

r/w/en

selectable

bool

r/w/en

Signals

Inherited:

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

Name

Short Description

activate

This is a keybinding signal, which will cause this row to be activated.

Fields

Inherited:

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

Name

Type

Access

Description

parent_instance

Gtk.Widget

r

Class Details

class Gtk.ListBoxRow(**kwargs)
Bases:

Gtk.Widget, Gtk.Actionable

Abstract:

No

Structure:

Gtk.ListBoxRowClass

GtkListBoxRow is the kind of widget that can be added to a GtkListBox.

classmethod new()[source]
Returns:

a new GtkListBoxRow

Return type:

Gtk.Widget

Creates a new GtkListBoxRow.

changed()[source]

Marks self as changed, causing any state that depends on this to be updated.

This affects sorting, filtering and headers.

Note that calls to this method must be in sync with the data used for the row functions. For instance, if the list is mirroring some external data set, and *two* rows changed in the external data set then when you call Gtk.ListBoxRow.changed() on the first row the sort function must only read the new data for the first of the two changed rows, otherwise the resorting of the rows will be wrong.

This generally means that if you don’t fully control the data model you have to duplicate the data that affects the listbox row functions into the row widgets themselves. Another alternative is to call [method`Gtk`.ListBox.invalidate_sort] on any model change, but that is more expensive.

get_activatable()[source]
Returns:

True if the row is activatable

Return type:

bool

Gets whether the row is activatable.

get_child()[source]
Returns:

the child widget of self

Return type:

Gtk.Widget or None

Gets the child widget of self.

get_header()[source]
Returns:

the current header

Return type:

Gtk.Widget or None

Returns the current header of the self.

This can be used in a [callback`Gtk`.ListBoxUpdateHeaderFunc] to see if there is a header set already, and if so to update the state of it.

get_index()[source]
Returns:

the index of the self, or -1 if the self is not in a listbox

Return type:

int

Gets the current index of the self in its GtkListBox container.

get_selectable()[source]
Returns:

True if the row is selectable

Return type:

bool

Gets whether the row can be selected.

is_selected()[source]
Returns:

True if self is selected

Return type:

bool

Returns whether the child is currently selected in its GtkListBox container.

set_activatable(activatable)[source]
Parameters:

activatable (bool) – True to mark the row as activatable

Set whether the row is activatable.

set_child(child)[source]
Parameters:

child (Gtk.Widget or None) – the child widget

Sets the child widget of self.

set_header(header)[source]
Parameters:

header (Gtk.Widget or None) – the header

Sets the current header of the self.

This is only allowed to be called from a [callback`Gtk`.ListBoxUpdateHeaderFunc]. It will replace any existing header in the row, and be shown in front of the row in the listbox.

set_selectable(selectable)[source]
Parameters:

selectable (bool) – True to mark the row as selectable

Set whether the row can be selected.

do_activate() virtual

Signal Details

Gtk.ListBoxRow.signals.activate(list_box_row)
Signal Name:

activate

Flags:

RUN_FIRST, ACTION

Parameters:

list_box_row (Gtk.ListBoxRow) – The object which received the signal

This is a keybinding signal, which will cause this row to be activated.

If you want to be notified when the user activates a row (by key or not), use the [signal`Gtk`.ListBox::row-activated] signal on the row’s parent GtkListBox.

Property Details

Gtk.ListBoxRow.props.activatable
Name:

activatable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Determines whether the ::row-activated signal will be emitted for this row.

Gtk.ListBoxRow.props.child
Name:

child

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The child widget.

Gtk.ListBoxRow.props.selectable
Name:

selectable

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Determines whether this row can be selected.