RE: How to remove all the selectd row in Treeview?



HI, 
I made a list with TreeView, I want to remove all the select 
rows, which
function I should use?
(the selection may have more than one row).


Set up a foreach scenario for all selected items:

        GtkTreeSelection *selection = NULL;

        selection = gtk_tree_view_get_selection(view);
        gtk_tree_selection_foreach(selection, remove_cb, NULL);

then in the callback:

        void remove_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer userdata)
        {
                GtkTreeStore *store = NULL;

                store = GTK_TREE_STORE(model);
                gtk_tree_store_remove(store, iter);
        }


Regards,
Martyn




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