Gtk.ListBase

g 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 Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable 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.ListBase Gtk.ListBase Gtk.Orientable->Gtk.ListBase Gtk.Scrollable->Gtk.ListBase Gtk.Widget->Gtk.ListBase

Subclasses:

Gtk.GridView, Gtk.ListView

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (16), Gtk.Buildable (1), Gtk.Orientable (2), Gtk.Scrollable (9)

Structs:

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

Virtual Methods

Inherited:

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

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.Orientable (1), Gtk.Scrollable (4)

Signals

Inherited:

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

Fields

Inherited:

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

Class Details

class Gtk.ListBase(**kwargs)
Bases:

Gtk.Widget, Gtk.Orientable, Gtk.Scrollable

Abstract:

Yes

Structure:

Gtk.ListBaseClass

GtkListBase is the abstract base class for GTK’s list widgets.

Shortcuts and Gestures

GtkListBase supports the following keyboard shortcuts:

  • <kbd>Ctrl</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>&sol;</kbd> selects all items.

  • <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>&bsol;</kbd> unselects all items.

The focused item is controlled by the navigation keys below, combined with the <kbd>Ctrl</kbd> modifier to prevent moving the selection, and the <kbd>Shift</kbd> modifier to extend the current selection.

  • <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move the focus on the next item in the designed direction.

  • <kbd>Home</kbd> and <kbd>End</kbd> focus the first or last item.

  • <kbd>PgUp</kbd> and <kbd>PgDn</kbd> move the focus one page up or down.

List item widgets support the following keyboard shortcuts:

  • <kbd>Enter</kbd> activates the item.

  • <kbd>␣</kbd> selects the item, with the same <kbd>Ctrl</kbd> and <kbd>Shift</kbd> modifiers combinations as the navigation keys.

Actions

GtkListBase defines a set of built-in actions:

  • list.scroll-to-item moves the visible area to the item at given position with the minimum amount of scrolling required. If the item is already visible, nothing happens.

  • list.select-item changes the selection.

  • list.select-all selects all items in the model, if the selection model supports it.

  • list.unselect-all unselects all items in the model, if the selection model supports it.

List item widgets install the following actions:

  • listitem.select changes selection if the item is selectable.

  • listitem.scroll-to moves the visible area of the list to this item with the minimum amount of scrolling required.