GtkTreeSelection

Name

GtkTreeSelection -- 

Synopsis


#include <gtk/gtk.h>


enum        GtkTreeSelectionType;
gboolean    (*GtkTreeSelectionFunc)         (GtkTreeSelection *selection,
                                             GtkTreeModel *model,
                                             GtkTreePath *path,
                                             gpointer data);
void        (*GtkTreeSelectionForeachFunc)  (GtkTreeModel *model,
                                             GtkTreeIter *iter,
                                             gpointer data);
GtkObject*  gtk_tree_selection_new          (void);
void        gtk_tree_selection_set_type     (GtkTreeSelection *selection,
                                             GtkTreeSelectionType type);
void        gtk_tree_selection_set_select_function
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionFunc func,
                                             gpointer data);
gpointer    gtk_tree_selection_get_user_data
                                            (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);
void        gtk_tree_selection_select_iter  (GtkTreeSelection *selection,
                                             GtkTreeIter *iter);
void        gtk_tree_selection_unselect_iter
                                            (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);
GtkObject*  gtk_tree_selection_new_with_tree_view
                                            (GtkTreeView *tree_view);
void        gtk_tree_selection_set_tree_view
                                            (GtkTreeSelection *selection,
                                             GtkTreeView *tree_view);

Description

Details

enum GtkTreeSelectionType

typedef enum
{
  GTK_TREE_SELECTION_SINGLE,
  GTK_TREE_SELECTION_MULTI
} GtkTreeSelectionType;


GtkTreeSelectionFunc ()

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

selection : 
model : 
path : 
data : 
Returns : 


GtkTreeSelectionForeachFunc ()

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

model : 
iter : 
data : 


gtk_tree_selection_new ()

GtkObject*  gtk_tree_selection_new          (void);

Creates a new GtkTreeSelection object. This function should not be invoked, as each GtkTreeView will create it's own GtkTreeSelection.

Returns : A newly created GtkTreeSelection object.


gtk_tree_selection_set_type ()

void        gtk_tree_selection_set_type     (GtkTreeSelection *selection,
                                             GtkTreeSelectionType type);

Sets the selection type of the selection. If the previous type was GTK_TREE_SELECTION_MULTI and type is GTK_TREE_SELECTION_SINGLE, then the anchor is kept selected, if it was previously selected.

selection : A GtkTreeSelection.
type : The selection type.


gtk_tree_selection_set_select_function ()

void        gtk_tree_selection_set_select_function
                                            (GtkTreeSelection *selection,
                                             GtkTreeSelectionFunc func,
                                             gpointer data);

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.

selection : A GtkTreeSelection.
func : The selection function.
data : The selection function's data.


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_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_TREE_SELECTION_SINGLE. Otherwise, it uses the anchor. 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.

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_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_select_all ()

void        gtk_tree_selection_select_all   (GtkTreeSelection *selection);

Selects all the nodes. If the type of selection is GTK_TREE_SELECTION_SINGLE, then the last row is selected.

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.


gtk_tree_selection_new_with_tree_view ()

GtkObject*  gtk_tree_selection_new_with_tree_view
                                            (GtkTreeView *tree_view);

Creates a new GtkTreeSelection object. This function should not be invoked, as each GtkTreeView will create it's own GtkTreeSelection.

tree_view : The GtkTreeView.
Returns : A newly created GtkTreeSelection object.


gtk_tree_selection_set_tree_view ()

void        gtk_tree_selection_set_tree_view
                                            (GtkTreeSelection *selection,
                                             GtkTreeView *tree_view);

Sets the GtkTreeView of selection. This function should not be invoked, as it is used internally by GtkTreeView.

selection : A GtkTreeSelection.
tree_view : The GtkTreeView.