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