Re: [gtkmm] treeview iterator



ok. thanks. It works. (I do not work with version 2.4 of gtkmm).
But I cannot figure out why operator -- is unefficient... Do you know ?

	Erwan

On Saturday 15 May 2004 17:39, Chris Vine wrote:
> On Friday 14 May 2004 09:41, Erwan Ancel wrote:
> > Hi,
> > I would like to know how to get an iterator to the row before the
> > selected one. I know that I can parse the whole list, but this is not
> > efficient at all.
> > This corresponds to a -- operator for the iterator (I can easily get the
> > next one with the ++ operator)
> > Does anyone know a way to get an iterator to the previous row efficiently
> > ?
>
> I think gtkmm-2.4 provides operator--(), but if you are using an earlier
> version (or want your users to be able to use an earlier version), or if
> you want efficiency when repeatedly iterating backwards, then you need to
> get at the path object, viz:
>
> Gtk::TreeModel::Path tree_path(selected_row_iter);
> tree_path.prev(); // tree_path now refers to the list store
>                   // preceding the selected one
> Gtk::TreeModel::iterator prev_row_iter =
> [treemodel_ref]->get_iter(tree_path);
>
> Chris
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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