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 <!-- ##### STRUCT GtkTreeSelection ##### -->
52 <!-- ##### SIGNAL GtkTreeSelection::changed ##### -->
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
60 @treeselection: the object which received the signal.
62 <!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
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.
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
75 @Returns: %TRUE, if the selection state of the row can be toggled
78 <!-- ##### USER_FUNCTION GtkTreeSelectionForeachFunc ##### -->
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.
84 @model: The #GtkTreeModel being viewed
85 @path: The #GtkTreePath of a selected row
86 @iter: A #GtkTreeIter pointing to a selected row
90 <!-- ##### FUNCTION gtk_tree_selection_set_mode ##### -->
99 <!-- ##### FUNCTION gtk_tree_selection_get_mode ##### -->
108 <!-- ##### FUNCTION gtk_tree_selection_set_select_function ##### -->
119 <!-- ##### FUNCTION gtk_tree_selection_get_select_function ##### -->
128 <!-- ##### FUNCTION gtk_tree_selection_get_user_data ##### -->
137 <!-- ##### FUNCTION gtk_tree_selection_get_tree_view ##### -->
146 <!-- ##### FUNCTION gtk_tree_selection_get_selected ##### -->
157 <!-- ##### FUNCTION gtk_tree_selection_selected_foreach ##### -->
167 <!-- ##### FUNCTION gtk_tree_selection_get_selected_rows ##### -->
177 <!-- ##### FUNCTION gtk_tree_selection_count_selected_rows ##### -->
186 <!-- ##### FUNCTION gtk_tree_selection_select_path ##### -->
195 <!-- ##### FUNCTION gtk_tree_selection_unselect_path ##### -->
204 <!-- ##### FUNCTION gtk_tree_selection_path_is_selected ##### -->
214 <!-- ##### FUNCTION gtk_tree_selection_select_iter ##### -->
223 <!-- ##### FUNCTION gtk_tree_selection_unselect_iter ##### -->
232 <!-- ##### FUNCTION gtk_tree_selection_iter_is_selected ##### -->
242 <!-- ##### FUNCTION gtk_tree_selection_select_all ##### -->
250 <!-- ##### FUNCTION gtk_tree_selection_unselect_all ##### -->
258 <!-- ##### FUNCTION gtk_tree_selection_select_range ##### -->
268 <!-- ##### FUNCTION gtk_tree_selection_unselect_range ##### -->