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