Re: TreeView - First element



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


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