Re: TreeView - First element
- From: smso graduate hku hk
- To: adam chyla gmail com
- Cc: gtkmm-list gnome org
- Subject: Re: TreeView - First element
- Date: Sun, 3 Jan 2010 10:53:38 +0800
My suggestion:
Gtk::TreeIter iter_selected = view->get_selection()->get_selected();
if (!iter_selected)
return;
// find index:
Gtk::TreePath path = model->get_path(iter_selected);
int index_selected = path[0];
int max_index = model->children().size() - 1;
if (index_selected == max_index) // only 1 row in model!
return;
// move to next row:
path.next();
Gtk::TreeIter iter = model->get_iter(path);
if (!iter)
return;
model->iter_swap(iter, iter_selected);
//or manually swap the rows...
//(*iter).set_value(...)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]