1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
<!-- ##### SECTION Title ##### -->
GtkTreeSelection
<!-- ##### SECTION Short_Description ##### -->
The selection object for #GtkTreeView
<!-- ##### SECTION Long_Description ##### -->
<para>
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 independentally 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.
</para>
<para>
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.
</para>
<para>
One of the important things to remember when monitoring the selection of
a view is that the "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 "changed" signal when nothing has happened
(mostly as a result of programmers calling select_row on an already
selected row).
</para>
<!-- ##### SECTION See_Also ##### -->
<para>
#GtkTreeView, #GtkTreeViewColumn, #GtkTreeDnd, #GtkTreeMode, #GtkTreeSortable, #GtkTreeModelSort, #GtkListStore, #GtkTreeStore, #GtkCellRenderer, #GtkCellEditable, #GtkCellRendererPixbuf, #GtkCellRendererText, #GtkCellRendererToggle
</para>
<!-- ##### STRUCT GtkTreeSelection ##### -->
<para>
</para>
<!-- ##### SIGNAL GtkTreeSelection::changed ##### -->
<para>
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.
</para>
@treeselection: the object which received the signal.
<!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
<para>
A function used by gtk_tree_selection_set_select_function() to filter
whether or not a row may be selected. It is called whenever a row's
state might change. A return value of %TRUE indicates to @selection
that it is okay to change the selection.
</para>
@selection: A #GtkTreeSelection
@model: A #GtkTreeModel being viewed
@path: The #GtkTreePath of the row in question
@path_currently_selected: %TRUE, if the path is currently selected
@data: user data
@Returns: %TRUE, if the selection state of the row can be toggled
<!-- ##### USER_FUNCTION GtkTreeSelectionForeachFunc ##### -->
<para>
A function used by gtk_tree_selection_selected_foreach() to map all
selected rows. It will be called on every selected row in the view.
</para>
@model: The #GtkTreeModel being viewed
@path: The #GtkTreePath of a selected row
@iter: A #GtkTreeIter pointing to a selected row
@data: user data
<!-- ##### FUNCTION gtk_tree_selection_set_mode ##### -->
<para>
</para>
@selection:
@type:
<!-- ##### FUNCTION gtk_tree_selection_get_mode ##### -->
<para>
</para>
@selection:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_set_select_function ##### -->
<para>
</para>
@selection:
@func:
@data:
@destroy:
<!-- ##### FUNCTION gtk_tree_selection_get_user_data ##### -->
<para>
</para>
@selection:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_get_tree_view ##### -->
<para>
</para>
@selection:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_get_selected ##### -->
<para>
</para>
@selection:
@model:
@iter:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_selected_foreach ##### -->
<para>
</para>
@selection:
@func:
@data:
<!-- ##### FUNCTION gtk_tree_selection_get_selected_rows ##### -->
<para>
</para>
@selection:
@model:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_count_selected_rows ##### -->
<para>
</para>
@selection:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_select_path ##### -->
<para>
</para>
@selection:
@path:
<!-- ##### FUNCTION gtk_tree_selection_unselect_path ##### -->
<para>
</para>
@selection:
@path:
<!-- ##### FUNCTION gtk_tree_selection_path_is_selected ##### -->
<para>
</para>
@selection:
@path:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_select_iter ##### -->
<para>
</para>
@selection:
@iter:
<!-- ##### FUNCTION gtk_tree_selection_unselect_iter ##### -->
<para>
</para>
@selection:
@iter:
<!-- ##### FUNCTION gtk_tree_selection_iter_is_selected ##### -->
<para>
</para>
@selection:
@iter:
@Returns:
<!-- ##### FUNCTION gtk_tree_selection_select_all ##### -->
<para>
</para>
@selection:
<!-- ##### FUNCTION gtk_tree_selection_unselect_all ##### -->
<para>
</para>
@selection:
<!-- ##### FUNCTION gtk_tree_selection_select_range ##### -->
<para>
</para>
@selection:
@start_path:
@end_path:
<!-- ##### FUNCTION gtk_tree_selection_unselect_range ##### -->
<para>
</para>
@selection:
@start_path:
@end_path:
|