Skip to content

Gtk.NoSelection

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

A selection model that does not allow selecting anything.

This model is meant to be used as a simple wrapper around a GListModel when a GtkSelectionModel is required.

GtkNoSelection passes through sections from the underlying model.

Constructors

new

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

Creates a new selection to handle model.

Parameters:

  • model — the GListModel to manage

Methods

get_model

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

Gets the model that self is wrapping.

set_model

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

Sets the model that self should wrap.

If model is None, this model 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 model being managed.

n_items

n_items: int  # read-only

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