Re: How to delete a multiple selection from a ListStore?



Thanks, I've had multiple suggestions already :)
I also suggested to put an item on the wiki about this, but I can't figure out how to add new items.

Joost

On 8/14/06, Andrew E. Makeev <andrew solvo ru> wrote:
В Втр, 08/08/2006 в 10:05 +0200, Joost Ellerbroek пишет:
> 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?

Hi,

dunno if you got answer already...
I suggest just use reverse iterator.

Regards,
-andrew





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