[gtkmm] iterating through a ListView



Ive 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!

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




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