SingleSelection

open class SingleSelection(pointer: <Error class: unknown class><<Error class: unknown class>>) : SelectionModel

GtkSingleSelection is a GtkSelectionModel that allows selecting a single item.

Note that the selection is persistent -- if the selected item is removed and re-added in the same signal@Gio.ListModel::items-changed emission, it stays selected. In particular, this means that changing the sort order of an underlying sort model will preserve the selection.

Constructors

Link copied to clipboard
constructor(model: <Error class: unknown class>? = null)

Creates a new selection to handle @model.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

If the selection will always select an item.

Link copied to clipboard

If unselecting the selected item is allowed.

Link copied to clipboard
open override val gioListModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val gtkSelectionModelPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtkSingleSelectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var model: <Error class: unknown class>?

The model being managed.

Link copied to clipboard
open var selected: <Error class: unknown class>

Position of the selected item.

Link copied to clipboard
open val selectedItem: <Error class: unknown class>?

The selected item.

Functions

Link copied to clipboard
open fun connectSelectionChanged(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Unit): <Error class: unknown class>

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

Link copied to clipboard

Checks if autoselect has been enabled or disabled via gtk_single_selection_set_autoselect().

Link copied to clipboard

If true, gtk_selection_model_unselect_item() is supported and allows unselecting the selected item.

Link copied to clipboard
open fun getModel(): <Error class: unknown class>?

Gets the model that @self is wrapping.

Link copied to clipboard
open fun getSelected(): <Error class: unknown class>

Gets the position of the selected item.

Link copied to clipboard
open fun getSelectedItem(): <Error class: unknown class>?

Gets the selected item.

Link copied to clipboard
open fun getSelection(): Bitset

Gets the set containing all currently selected items in the model.

Link copied to clipboard
open fun getSelectionInRange(position: <Error class: unknown class>, nItems: <Error class: unknown class>): Bitset

Gets the set of selected items in a range.

Link copied to clipboard
open fun isSelected(position: <Error class: unknown class>): Boolean

Checks if the given item is selected.

Link copied to clipboard
open fun selectAll(): Boolean

Requests to select all items in the model.

Link copied to clipboard
open fun selectionChanged(position: <Error class: unknown class>, nItems: <Error class: unknown class>)

Helper function for implementations of GtkSelectionModel.

Link copied to clipboard
open fun selectItem(position: <Error class: unknown class>, unselectRest: Boolean): Boolean

Requests to select an item in the model.

Link copied to clipboard
open fun selectRange(position: <Error class: unknown class>, nItems: <Error class: unknown class>, unselectRest: Boolean): Boolean

Requests to select a range of items in the model.

Link copied to clipboard
open fun setAutoselect(autoselect: Boolean)

Enables or disables autoselect.

Link copied to clipboard
open fun setCanUnselect(canUnselect: Boolean)

If true, unselecting the current item via gtk_selection_model_unselect_item() is supported.

Link copied to clipboard
open fun setModel(model: <Error class: unknown class>? = null)

Sets the model that @self should wrap.

Link copied to clipboard
open fun setSelected(position: <Error class: unknown class>)

Selects the item at the given position.

Link copied to clipboard
open fun setSelection(selected: Bitset, mask: Bitset): Boolean

Make selection changes.

Link copied to clipboard
open fun unselectAll(): Boolean

Requests to unselect all items in the model.

Link copied to clipboard
open fun unselectItem(position: <Error class: unknown class>): Boolean

Requests to unselect an item in the model.

Link copied to clipboard
open fun unselectRange(position: <Error class: unknown class>, nItems: <Error class: unknown class>): Boolean

Requests to unselect a range of items in the model.