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 "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 <!-- ##### STRUCT GtkTreeSelection ##### -->
49 <!-- ##### USER_FUNCTION GtkTreeSelectionFunc ##### -->
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.
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
62 @Returns: %TRUE, if the selection state of the row can be toggled
65 <!-- ##### USER_FUNCTION GtkTreeSelectionForeachFunc ##### -->
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.
71 @model: The #GtkTreeModel being viewed
72 @path: The #GtkTreePath of a selected row
73 @iter: A #GtkTreeIter pointing to a selected row
77 <!-- ##### FUNCTION gtk_tree_selection_set_mode ##### -->
86 <!-- ##### FUNCTION gtk_tree_selection_get_mode ##### -->
95 <!-- ##### FUNCTION gtk_tree_selection_set_select_function ##### -->
106 <!-- ##### FUNCTION gtk_tree_selection_get_user_data ##### -->
115 <!-- ##### FUNCTION gtk_tree_selection_get_tree_view ##### -->
124 <!-- ##### FUNCTION gtk_tree_selection_get_selected ##### -->
135 <!-- ##### FUNCTION gtk_tree_selection_selected_foreach ##### -->
145 <!-- ##### FUNCTION gtk_tree_selection_get_selected_rows ##### -->
155 <!-- ##### FUNCTION gtk_tree_selection_count_selected_rows ##### -->
164 <!-- ##### FUNCTION gtk_tree_selection_select_path ##### -->
173 <!-- ##### FUNCTION gtk_tree_selection_unselect_path ##### -->
182 <!-- ##### FUNCTION gtk_tree_selection_path_is_selected ##### -->
192 <!-- ##### FUNCTION gtk_tree_selection_select_iter ##### -->
201 <!-- ##### FUNCTION gtk_tree_selection_unselect_iter ##### -->
210 <!-- ##### FUNCTION gtk_tree_selection_iter_is_selected ##### -->
220 <!-- ##### FUNCTION gtk_tree_selection_select_all ##### -->
228 <!-- ##### FUNCTION gtk_tree_selection_unselect_all ##### -->
236 <!-- ##### FUNCTION gtk_tree_selection_select_range ##### -->
246 <!-- ##### FUNCTION gtk_tree_selection_unselect_range ##### -->
256 <!-- ##### SIGNAL GtkTreeSelection::changed ##### -->
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
264 @treeselection: the object which received the signal.