Re: TreeView - First element



It still make an error


Juan A. Moreno wrote:
> 
>>       *  if* (ListTreeModel->children().end() != iter)
>>             ListTreeModel->iter_swap(iter, iter++);
>>
> 
> Not sure, but I think children().end() is one past the last element so
> when
> you select the last element in the treeview "ListTreeModel->children() !=
> iter" is true but "iter++" is not a valid iter. Can you try with this?:
> 
> *void* fun::fun_move_down()
> {
>   *  if* (!ListTreeView.get_hover_selection())
>     {
>         *Glib::RefPtr<Gtk::TreeSelection>* ref =
> ListTreeView.get_selection();
>         *Gtk::TreeModel::iterator* iter = ref->get_selected();
> *        Gtk::TreeModel::iterator* other_iter = iter++;
> 
>       *  if* (ListTreeModel->children().end() != other_iter)
>             ListTreeModel->iter_swap(iter, other_iter);
>     }
> }
> 
> 
> -- 
> Atentamente:
> Juan Ángel Moreno Fernández
> jamf gm gmail com
> ------------------------------
>  Proyecto Gelide
>  http://gelide.sf.net
> ------------------------------
> 
> _______________________________________________
> 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-tp26987764p26994541.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]