TreeSelection
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
parameter
model
: model: Out parameter is not supportedparameter
model
: model: Out parameter is not supported
Constructors
Properties
Functions
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.
Returns the number of rows that have been selected in @tree.
Gets the selection mode for @selection. See gtk_tree_selection_set_mode().
Returns the tree view associated with @selection.
Returns true if the row at @iter is currently selected.
Returns true if the row pointed to by @path is currently selected. If @path does not point to a valid location, false is returned
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.
Selects the specified iterator.
Select the row at @path.
Selects a range of nodes, determined by @start_path and @end_path inclusive.
Sets the selection mode of the @selection. If the previous type was %GTK_SELECTION_MULTIPLE, then the anchor is kept selected, if it was previously selected.
Sets the selection function.
Unselects all the nodes.
Unselects the specified iterator.
Unselects the row at @path.
Unselects a range of nodes, determined by @start_path and @end_path inclusive.