How to delete a multiple selection from a ListStore?



I want to be able to delete / cut / copy and paste multiple-selections in a TreeView.

What I do now obviously doesn't work correctly, presumably because the iterators pointing to the rows change as soon as I change the model?
This is what I do now:
----------------code snippet:
std::vector<Gtk::TreeModel::Path> pathlist = pView->get_selection()->get_selected_rows();
for (std::vector<Gtk::TreeModel::Path>::iterator i = pathlist.begin(); i != pathlist.end(); ++i)
                pd_expModel->erase(pd_expModel->get_iter (*i));
----------------

What would be the correct way to delete a multiple selection from the model?

cheers, Joost


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