Re: TreeView - First element



Hi,
So, What should I do that code run properly?
What is end() and begin()?

Happy new year.


Mark Roberts-10 wrote:
> 
> Dear Adam,
> 
>>> If there is indeed an error in gtkmm itself, it would help if you could
>>> provide a small self-contained test case for us to try.
> 
>> http://chyla.tk/gtk_foobar-0.1.tar.gz
> 
>> void MainClass::MoveDownFun()
>> {
>>     Glib::RefPtr<Gtk::TreeSelection> selection =
>>         TreeViewExample.get_selection();
>>     Gtk::TreeModel::iterator iter = selection->get_selected();
>>
>>     if (iter) // it must not be selected
>>         if (ListStore->children().end() != iter)
>>             ListStore->iter_swap(iter, iter++);
>> }
> 
> The error Juan pointed out is still there:
> 
> In last line but one you should be checking that iter is not the last 
> element in the list. That is not what you are checking, because end() is 
> _not_ the last element. It follows that when iter is the last element in 
> the list, you execute iter_swap with iter++ anyway, which is invalid.
> 
> All the best and a happy new year,
> Mark
> _______________________________________________
> 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-tp26987764p26997344.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]