GtkTreeSelection

Name

GtkTreeSelection -- 

Synopsis


#include <gtk/gtk.h>


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);
GtkSelectionMode gtk_tree_selection_get_mode
                                            (GtkTreeSelection *selection);
void        gtk_tree_selection_set_select_function
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionFunc func,
                                             gpointer data,
                                             GtkDestroyNotify destroy);
gpointer    gtk_tree_selection_get_user_data
                                            (GtkTreeSelection *selection);
GtkTreeView* gtk_tree_selection_get_tree_view
                                            (GtkTreeSelection *selection);
gboolean    gtk_tree_selection_get_selected (GtkTreeSelection *selection,
                                             GtkTreeModel **model,
                                             GtkTreeIter *iter);
void        gtk_tree_selection_selected_foreach
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionForeachFunc func,
                                             gpointer data);
void        gtk_tree_selection_select_path  (GtkTreeSelection *selection,
                                             GtkTreePath *path);
void        gtk_tree_selection_unselect_path
                                            (GtkTreeSelection *selection,
                                             GtkTreePath *path);
gboolean    gtk_tree_selection_path_is_selected
                                            (GtkTreeSelection *selection,
                                             GtkTreePath *path);
void        gtk_tree_selection_select_iter  (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);
void        gtk_tree_selection_unselect_iter
                                            (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);
gboolean    gtk_tree_selection_iter_is_selected
                                            (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);
void        gtk_tree_selection_select_all   (GtkTreeSelection *selection);
void        gtk_tree_selection_unselect_all (GtkTreeSelection *selection);
void        gtk_tree_selection_select_range (GtkTreeSelection *selection,
                                             GtkTreePath *start_path,
                                             GtkTreePath *end_path);

Object Hierarchy


  GObject
   +----GtkTreeSelection

Signal Prototypes


"changed"   void        user_function      (GtkTreeSelection *treeselection,
                                            gpointer user_data);

Description

Details

GtkTreeSelectionFunc ()

gboolean    (*GtkTreeSelectionFunc)         (GtkTreeSelection *selection,
                                             GtkTreeModel *model,
                                             GtkTreePath *path,
                                             gboolean path_currently_selected,
                                             gpointer data);

selection : 
model : 
path : 
path_currently_selected : 
data : 
Returns : 


GtkTreeSelectionForeachFunc ()

void        (*GtkTreeSelectionForeachFunc)  (GtkTreeModel *model,
                                             GtkTreePath *path,
                                             GtkTreeIter *iter,
                                             gpointer data);

model : 
path : 
iter : 
data : 


gtk_tree_selection_set_mode ()

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.

selection : A GtkTreeSelection.
type : The selection mode


gtk_tree_selection_get_mode ()

GtkSelectionMode gtk_tree_selection_get_mode
                                            (GtkTreeSelection *selection);

Gets the selection mode for selection. See gtk_tree_selection_set_mode().

selection : a GtkTreeSelection
Returns : the current selection mode


gtk_tree_selection_set_select_function ()

void        gtk_tree_selection_set_select_function
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionFunc func,
                                             gpointer data,
                                             GtkDestroyNotify 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.

selection : A GtkTreeSelection.
func : The selection function.
data : The selection function's data.
destroy : The destroy function for user data. May be NULL.


gtk_tree_selection_get_user_data ()

gpointer    gtk_tree_selection_get_user_data
                                            (GtkTreeSelection *selection);

Returns the user data for the selection function.

selection : A GtkTreeSelection.
Returns : The user data.


gtk_tree_selection_get_tree_view ()

GtkTreeView* gtk_tree_selection_get_tree_view
                                            (GtkTreeSelection *selection);

Returns the tree view associated with selection.

selection : A GtkTreeSelection
Returns : A GtkTreeView


gtk_tree_selection_get_selected ()

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 : A GtkTreeSelection.
model : A pointer set to the GtkTreeModel, or NULL.
iter : The GtkTreeIter, or NULL.
Returns : TRUE, if there is a selected node.


gtk_tree_selection_selected_foreach ()

void        gtk_tree_selection_selected_foreach
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionForeachFunc func,
                                             gpointer data);

Calls a function for each selected node.

selection : A GtkTreeSelection.
func : The function to call for each selected node.
data : user data to pass to the function.


gtk_tree_selection_select_path ()

void        gtk_tree_selection_select_path  (GtkTreeSelection *selection,
                                             GtkTreePath *path);

Select the row at path.

selection : A GtkTreeSelection.
path : The GtkTreePath to be selected.


gtk_tree_selection_unselect_path ()

void        gtk_tree_selection_unselect_path
                                            (GtkTreeSelection *selection,
                                             GtkTreePath *path);

Unselects the row at path.

selection : A GtkTreeSelection.
path : The GtkTreePath to be unselected.


gtk_tree_selection_path_is_selected ()

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

selection : A GtkTreeSelection.
path : A GtkTreePath to check selection on.
Returns : TRUE if path is selected.


gtk_tree_selection_select_iter ()

void        gtk_tree_selection_select_iter  (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);

Selects the specified iterator.

selection : A GtkTreeSelection.
iter : The GtkTreeIter to be selected.


gtk_tree_selection_unselect_iter ()

void        gtk_tree_selection_unselect_iter
                                            (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);

Unselects the specified iterator.

selection : A GtkTreeSelection.
iter : The GtkTreeIter to be unselected.


gtk_tree_selection_iter_is_selected ()

gboolean    gtk_tree_selection_iter_is_selected
                                            (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);

Returns TRUE if the row pointed to by path is currently selected.

selection : A GtkTreeSelection
iter : A valid GtkTreeIter
Returns : TRUE, if iter is selected


gtk_tree_selection_select_all ()

void        gtk_tree_selection_select_all   (GtkTreeSelection *selection);

Selects all the nodes. selection is must be set to GTK_SELECTION_MULTIPLE mode.

selection : A GtkTreeSelection.


gtk_tree_selection_unselect_all ()

void        gtk_tree_selection_unselect_all (GtkTreeSelection *selection);

Unselects all the nodes.

selection : A GtkTreeSelection.


gtk_tree_selection_select_range ()

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 : A GtkTreeSelection.
start_path : The initial node of the range.
end_path : The final node of the range.

Signals

The "changed" signal

void        user_function                  (GtkTreeSelection *treeselection,
                                            gpointer user_data);

treeselection :the object which received the signal.
user_data :user data set when the signal handler was connected.