TreeSelection

open class TreeSelection(val gtkTreeSelectionPointer: <Error class: unknown class><<Error class: unknown class>>)(source)

⚠️ Deprecated ⚠️

This is deprecated since version 4.10.

Use iface@Gtk.SelectionModel instead

---

The selection object for GtkTreeView

The GtkTreeSelection object is a helper object to manage the selection for a GtkTreeView widget. The GtkTreeSelection object is automatically created when a new GtkTreeView widget is created, and cannot exist independently of this widget. The primary reason the GtkTreeSelection objects exists is for cleanliness of code and API. That is, there is no conceptual reason all these functions could not be methods on the GtkTreeView widget instead of a separate function.

The GtkTreeSelection object is gotten from a GtkTreeView by calling gtk_tree_view_get_selection(). It can be manipulated to check the selection status of the tree, as well as select and deselect individual rows. Selection is done completely view side. As a result, multiple views of the same model can have completely different selections. Additionally, you cannot change the selection of a row on the model that is not currently displayed by the view without expanding its parents first.

One of the important things to remember when monitoring the selection of a view is that the GtkTreeSelection::changed signal is mostly a hint. That is, it may only emit one signal when a range of rows is selected. Additionally, it may on occasion emit a GtkTreeSelection::changed signal when nothing has happened (mostly as a result of programmers calling select_row on an already selected row).

Skipped during bindings generation

  • method get_select_function: Return type TreeSelectionFunc is not supported

  • parameter model: model: Out parameter is not supported

  • parameter model: model: Out parameter is not supported

Constructors

Link copied to clipboard
constructor(gtkTreeSelectionPointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val gtkTreeSelectionPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

Selection mode. See gtk_tree_selection_set_mode() for more information on this property.

Functions

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

This is deprecated since version 4.10.

Link copied to clipboard

Emits the "changed" signal. See onChanged.

Link copied to clipboard
open fun getTreeView(): TreeView

This is deprecated since version 4.10.

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

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

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

Emitted whenever the selection has (possibly) changed. Please note that this signal is mostly a hint. It may only be emitted once when a range of rows are selected, and it may occasionally be emitted when nothing has happened.

Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard
open fun selectAll()

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard
open fun selectIter(iter: TreeIter)

This is deprecated since version 4.10.

Link copied to clipboard
open fun selectPath(path: TreePath)

This is deprecated since version 4.10.

Link copied to clipboard
open fun selectRange(startPath: TreePath, endPath: TreePath)

This is deprecated since version 4.10.

Link copied to clipboard

This is deprecated since version 4.10.

Link copied to clipboard
open fun unselectAll()

This is deprecated since version 4.10.

Link copied to clipboard
open fun unselectIter(iter: TreeIter)

This is deprecated since version 4.10.

Link copied to clipboard
open fun unselectPath(path: TreePath)

This is deprecated since version 4.10.

Link copied to clipboard
open fun unselectRange(startPath: TreePath, endPath: TreePath)

This is deprecated since version 4.10.