Re: [gtkmm] iterating through a ListView



On Sat, 2004-02-21 at 16:09, Andreas B. Thun wrote:
> I´ve found a way to select the next line in a ListView
> by incrementing Gtk::TreeModel::iterator.
> 
> The question is now: How can I decrement a Gtk::TreeModel::iterator??
> There is no -- operator!

There is in gtkmm 2.4. You might look at its implementation for a
workaround - I think you convert the iter to a path, do something to it,
and convert it back to an iter. operator-- will be slower than
operator++ because the underlying model does not have direct support for
it.

> 
> I want to select the prev. line..
> 
> 
> // Select next line in my ListView
> void ConstraintTable::onNextClicked()
> {
>    Gtk::TreeModel::iterator curr_iter = m_tree_sel_ref->get_selected();
>    if (curr_iter){
>      if(++curr_iter) {
> 	  Gtk::TreePath path(curr_iter);
> 	  m_tree_sel_ref->select(curr_iter);
> 	  m_tree_view.scroll_to_row(path);
> 	}
>    }
> }
> 
> 
> TIA,
> Andi
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com




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