Interface

Gtk-4.0GtkSelectionModelSignalSignatures

interface SignalSignatures {
    "items-changed": (
        position: number,
        removed: number,
        added: number,
    ) => void;
    "selection-changed": (position: number, n_items: number) => void;
}

Hierarchy (View Summary)

Index
"selection-changed": (position: number, n_items: number) => void

Emitted when the selection state of some of the items in model changes.

Note that this signal does not specify the new selection state of the items, they need to be queried manually. It is also not necessary for a model to change the selection state of any of the items in the selection model, though it would be rather useless to emit such a signal.

::: warning Note that you have to be careful when modifying the model in signal handlers, as it may cause reentrancy problems. This is also the case when you modify base models underneath the selection model. When in doubt, defer changes to an idle.

"items-changed": (position: number, removed: number, added: number) => void

This signal is emitted whenever items were added to or removed from list. At position, removed items were removed and added items were added in their place.

Note: If removed != added, the positions of all later items in the model change.

2.44