Top |
gboolean | (*GtkTreeSelectionFunc) () |
void | (*GtkTreeSelectionForeachFunc) () |
void | gtk_tree_selection_set_mode () |
GtkSelectionMode | gtk_tree_selection_get_mode () |
void | gtk_tree_selection_set_select_function () |
GtkTreeSelectionFunc | gtk_tree_selection_get_select_function () |
gpointer | gtk_tree_selection_get_user_data () |
GtkTreeView * | gtk_tree_selection_get_tree_view () |
gboolean | gtk_tree_selection_get_selected () |
void | gtk_tree_selection_selected_foreach () |
GList * | gtk_tree_selection_get_selected_rows () |
gint | gtk_tree_selection_count_selected_rows () |
void | gtk_tree_selection_select_path () |
void | gtk_tree_selection_unselect_path () |
gboolean | gtk_tree_selection_path_is_selected () |
void | gtk_tree_selection_select_iter () |
void | gtk_tree_selection_unselect_iter () |
gboolean | gtk_tree_selection_iter_is_selected () |
void | gtk_tree_selection_select_all () |
void | gtk_tree_selection_unselect_all () |
void | gtk_tree_selection_select_range () |
void | gtk_tree_selection_unselect_range () |
gboolean (*GtkTreeSelectionFunc) (GtkTreeSelection *selection
,GtkTreeModel *model
,GtkTreePath *path
,gboolean path_currently_selected
,gpointer data
);
void (*GtkTreeSelectionForeachFunc) (GtkTreeModel *model
,GtkTreePath *path
,GtkTreeIter *iter
,gpointer data
);
void gtk_tree_selection_set_mode (GtkTreeSelection *selection
,GtkSelectionMode type
);
Sets the selection mode of the selection
. If the previous type was
GTK_SELECTION_MULTIPLE, then the anchor is kept selected, if it was
previously selected.
GtkSelectionMode
gtk_tree_selection_get_mode (GtkTreeSelection *selection
);
Gets the selection mode for selection
. See
gtk_tree_selection_set_mode()
.
void gtk_tree_selection_set_select_function (GtkTreeSelection *selection
,GtkTreeSelectionFunc func
,gpointer data
,GDestroyNotify destroy
);
Sets the selection function. If set, this function is called before any node
is selected or unselected, giving some control over which nodes are selected.
The select function should return TRUE
if the state of the node may be toggled,
and FALSE
if the state of the node should be left unchanged.
GtkTreeSelectionFunc
gtk_tree_selection_get_select_function
(GtkTreeSelection *selection
);
Returns the current selection function.
[skip]
Since: 2.14
gpointer
gtk_tree_selection_get_user_data (GtkTreeSelection *selection
);
Returns the user data for the selection function.
[skip]
GtkTreeView *
gtk_tree_selection_get_tree_view (GtkTreeSelection *selection
);
Returns the tree view associated with selection
.
gboolean gtk_tree_selection_get_selected (GtkTreeSelection *selection
,GtkTreeModel **model
,GtkTreeIter *iter
);
Sets iter
to the currently selected node if selection
is set to
GTK_SELECTION_SINGLE or GTK_SELECTION_BROWSE. iter
may be NULL if you
just want to test if selection
has any selected nodes. model
is filled
with the current model as a convenience. This function will not work if you
use selection
is GTK_SELECTION_MULTIPLE.
selection |
||
model |
A pointer to set to the GtkTreeModel, or NULL. |
[out][allow-none][transfer none] |
iter |
The GtkTreeIter, or NULL. |
[out][allow-none] |
void gtk_tree_selection_selected_foreach (GtkTreeSelection *selection
,GtkTreeSelectionForeachFunc func
,gpointer data
);
Calls a function for each selected node. Note that you cannot modify
the tree or selection from within this function. As a result,
gtk_tree_selection_get_selected_rows()
might be more useful.
GList * gtk_tree_selection_get_selected_rows (GtkTreeSelection *selection
,GtkTreeModel **model
);
Creates a list of path of all selected rows. Additionally, if you are
planning on modifying the model after calling this function, you may
want to convert the returned list into a list of GtkTreeRowReferences.
To do this, you can use gtk_tree_row_reference_new()
.
To free the return value, use:
1 2 |
g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); g_list_free (list); |
selection |
||
model |
A pointer to set to the GtkTreeModel, or |
[out][allow-none][transfer none] |
A GList containing a GtkTreePath for each selected row.
[element-type GtkTreePath][transfer full]
Since: 2.2
gint
gtk_tree_selection_count_selected_rows
(GtkTreeSelection *selection
);
Returns the number of rows that have been selected in tree
.
Since: 2.2
void gtk_tree_selection_select_path (GtkTreeSelection *selection
,GtkTreePath *path
);
Select the row at path
.
void gtk_tree_selection_unselect_path (GtkTreeSelection *selection
,GtkTreePath *path
);
Unselects the row at path
.
gboolean gtk_tree_selection_path_is_selected (GtkTreeSelection *selection
,GtkTreePath *path
);
Returns TRUE
if the row pointed to by path
is currently selected. If path
does not point to a valid location, FALSE
is returned
void gtk_tree_selection_select_iter (GtkTreeSelection *selection
,GtkTreeIter *iter
);
Selects the specified iterator.
void gtk_tree_selection_unselect_iter (GtkTreeSelection *selection
,GtkTreeIter *iter
);
Unselects the specified iterator.
gboolean gtk_tree_selection_iter_is_selected (GtkTreeSelection *selection
,GtkTreeIter *iter
);
Returns TRUE
if the row at iter
is currently selected.
void
gtk_tree_selection_select_all (GtkTreeSelection *selection
);
Selects all the nodes. selection
must be set to GTK_SELECTION_MULTIPLE
mode.
void
gtk_tree_selection_unselect_all (GtkTreeSelection *selection
);
Unselects all the nodes.
void gtk_tree_selection_select_range (GtkTreeSelection *selection
,GtkTreePath *start_path
,GtkTreePath *end_path
);
Selects a range of nodes, determined by start_path
and end_path
inclusive.
selection
must be set to GTK_SELECTION_MULTIPLE mode.
void gtk_tree_selection_unselect_range (GtkTreeSelection *selection
,GtkTreePath *start_path
,GtkTreePath *end_path
);
Unselects a range of nodes, determined by start_path
and end_path
inclusive.
selection |
||
start_path |
The initial node of the range. |
|
end_path |
The initial node of the range. |
Since: 2.2
“changed”
signalvoid user_function (GtkTreeSelection *treeselection, gpointer user_data)
Flags: Run First