Re: Selection with simple click on GtkTreeView



Hi.

> gchar*
> get_entry_list (GtkTreeView *TreeView, gint Cols)
> {
>     GtkTreeModel *Model = gtk_tree_view_get_model (TreeView);
>     GtkTreeSelection *Select = gtk_tree_view_get_selection (TreeView);
>     gtk_tree_selection_set_mode (Select, GTK_SELECTION_SINGLE);
>     GtkTreeIter pIter;
>     gchar *ID = NULL;
>
>
>     if (gtk_tree_selection_get_selected (Select, &Model, &pIter))
>     {
>     gtk_tree_model_get (Model, &pIter, Cols, &ID, -1);
>     }
>
>     return ID;
> }

My guess would be that gtk_tree_selection_set_mode() is the culprit of
your troubles. You don't need to call it every time you retrieve
selected data, you only need to do it once (usually when tree view is
created). Try removing that function call and I'm almost sure things
will start working.

Tadej

-- 
Tadej Borovšak
tadeboro.blogspot.com
tadeboro gmail com
tadej borovsak gmail com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]