Skip to content

Gtk.MultiSelection

class — extends GObject.Object, Gio.ListModel, SectionModel, SelectionModel

A selection model that allows selecting multiple elements.

Constructors

new

@classmethod
def new(cls, model: Gio.ListModel | None = ...) -> MultiSelection

Creates a new selection to handle model.

Parameters:

  • model — the GListModel to manage

Methods

get_model

def get_model(self) -> Gio.ListModel | None

Returns the underlying model of self.

set_model

def set_model(self, model: Gio.ListModel | None = ...) -> None

Sets the model that self should wrap.

If model is None, self will be empty.

Parameters:

  • model — A GListModel to wrap

Properties

item_type

item_type: type | GObject.Type  # read-only

The type of items. See Gio.ListModel.get_item_type.

model

model: Gio.ListModel  # read/write

The list managed by this selection.

n_items

n_items: int  # read-only

The number of items. See Gio.ListModel.get_n_items.