Re: TreeView - First element
- From: "Adam Chyla [PL]" <adam chyla gmail com>
- To: gtkmm-list gnome org
- Subject: Re: TreeView - First element
- Date: Sun, 3 Jan 2010 01:40:05 -0800 (PST)
Thank You verry much.
smso wrote:
>
>
> 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(...)
>
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>
>
--
View this message in context: http://old.nabble.com/TreeView---First-element-tp26987764p27000117.html
Sent from the Gtkmm mailing list archive at Nabble.com.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]