TreeSelection

open class TreeSelection(pointer: <Error class: unknown class><<Error class: unknown class>>)

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 unsupported

  • parameter model: model: Out parameter is not supported

  • parameter model: model: Out parameter is not supported

Constructors

Link copied to clipboard
constructor(pointer: <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
fun connectChanged(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
open fun countSelectedRows(): <Error class: unknown class>

Returns the number of rows that have been selected in @tree.

Link copied to clipboard
open fun getTreeView(): TreeView

Returns the tree view associated with @selection.

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

Returns the user data for the selection function.

Link copied to clipboard

Returns true if the row at @iter is currently selected.

Link copied to clipboard

Returns true if the row pointed to by @path is currently selected. If @path does not point to a valid location, false is returned

Link copied to clipboard
open fun selectAll()

Selects all the nodes. @selection must be set to %GTK_SELECTION_MULTIPLE mode.

Link copied to clipboard

Calls a function for each selected node. Note that you cannot modify the tree or selection from within this function. As a result, gtk_tree_selection_get_selected_rows() might be more useful.

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

Selects the specified iterator.

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

Select the row at @path.

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

Selects a range of nodes, determined by @start_path and @end_path inclusive.

Link copied to clipboard

Sets the selection function.

Link copied to clipboard
open fun unselectAll()

Unselects all the nodes.

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

Unselects the specified iterator.

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

Unselects the row at @path.

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

Unselects a range of nodes, determined by @start_path and @end_path inclusive.