1
<!-- ##### SECTION Title ##### -->
4
<!-- ##### SECTION Short_Description ##### -->
5
The selection object for GtkTreeView
7
<!-- ##### SECTION Long_Description ##### -->
9
The #GtkTreeSelection object is a helper object to manage the selection
10
for a #GtkTreeView widget. The #GtkTreeSelection object is
11
automatically created when a new #GtkTreeView widget is created, and
12
cannot exist independentally of this widget. The primary reason the
13
#GtkTreeSelection objects exists is for cleanliness of code and API.
14
That is, there is no conceptual reason all these functions could not be
15
methods on the #GtkTreeView widget instead of a separate function.
19
The #GtkTreeSelection object is gotten from a #GtkTreeView by calling
20
gtk_tree_view_get_selection(). It can be manipulated to check the
21
selection status of the tree, as well as select and deselect individual
22
rows. Selection is done completely view side. As a result, multiple
23
views of the same model can have completely different selections.
24
Additionally, you cannot change the selection of a row on the model that
25
is not currently displayed by the view without expanding its parents
30
One of the important things to remember when monitoring the selection of
31
a view is that the #GtkTreeSelection::changed signal is mostly a hint. That is, it may
32
only emit one signal when a range of rows is selected. Additionally, it
33
may on occasion emit a ::changed signal when nothing has happened
34
(mostly as a result of programmers calling select_row on an already
38
<!-- ##### SECTION See_Also ##### -->
40
#GtkTreeView, #GtkTreeViewColumn, #GtkTreeDnd, #GtkTreeMode, #GtkTreeSortable, #GtkTreeModelSort, #GtkListStore, #GtkTreeStore, #GtkCellRenderer, #GtkCellEditable, #GtkCellRendererPixbuf, #GtkCellRendererText, #GtkCellRendererToggle
43
<!-- ##### SECTION Stability_Level ##### -->
46
<!-- ##### SECTION Image ##### -->
49
<!-- ##### STRUCT GtkTreeSelection ##### -->
55
<!-- ##### SIGNAL GtkTreeSelection::changed ##### -->
57
Emitted whenever the selection has (possibly) changed. Please note that
58
this signal is mostly a hint. It may only be emitted once when a range
59
of rows are selected, and it may occasionally be emitted when nothing
63
@treeselection: the object which received the signal.
65
<!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
67
A function used by gtk_tree_selection_set_select_function() to filter
68
whether or not a row may be selected. It is called whenever a row's
69
state might change. A return value of %TRUE indicates to @selection
70
that it is okay to change the selection.
73
@selection: A #GtkTreeSelection
74
@model: A #GtkTreeModel being viewed
75
@path: The #GtkTreePath of the row in question
76
@path_currently_selected: %TRUE, if the path is currently selected
78
@Returns: %TRUE, if the selection state of the row can be toggled
81
<!-- ##### USER_FUNCTION GtkTreeSelectionForeachFunc ##### -->
83
A function used by gtk_tree_selection_selected_foreach() to map all
84
selected rows. It will be called on every selected row in the view.
87
@model: The #GtkTreeModel being viewed
88
@path: The #GtkTreePath of a selected row
89
@iter: A #GtkTreeIter pointing to a selected row
93
<!-- ##### FUNCTION gtk_tree_selection_set_mode ##### -->
102
<!-- ##### FUNCTION gtk_tree_selection_get_mode ##### -->
111
<!-- ##### FUNCTION gtk_tree_selection_set_select_function ##### -->
122
<!-- ##### FUNCTION gtk_tree_selection_get_select_function ##### -->
131
<!-- ##### FUNCTION gtk_tree_selection_get_user_data ##### -->
140
<!-- ##### FUNCTION gtk_tree_selection_get_tree_view ##### -->
149
<!-- ##### FUNCTION gtk_tree_selection_get_selected ##### -->
160
<!-- ##### FUNCTION gtk_tree_selection_selected_foreach ##### -->
170
<!-- ##### FUNCTION gtk_tree_selection_get_selected_rows ##### -->
180
<!-- ##### FUNCTION gtk_tree_selection_count_selected_rows ##### -->
189
<!-- ##### FUNCTION gtk_tree_selection_select_path ##### -->
198
<!-- ##### FUNCTION gtk_tree_selection_unselect_path ##### -->
207
<!-- ##### FUNCTION gtk_tree_selection_path_is_selected ##### -->
217
<!-- ##### FUNCTION gtk_tree_selection_select_iter ##### -->
226
<!-- ##### FUNCTION gtk_tree_selection_unselect_iter ##### -->
235
<!-- ##### FUNCTION gtk_tree_selection_iter_is_selected ##### -->
245
<!-- ##### FUNCTION gtk_tree_selection_select_all ##### -->
253
<!-- ##### FUNCTION gtk_tree_selection_unselect_all ##### -->
261
<!-- ##### FUNCTION gtk_tree_selection_select_range ##### -->
271
<!-- ##### FUNCTION gtk_tree_selection_unselect_range ##### -->