I am subclasssing Gtk::ListStore and overriding Gtk::TreeDragSource::drag_data_delete_vfunc and Gtk::TreeDragDest::drag_data_received_vfunc. In these methods I use Gtk::ListStore::move instead of Gtk::ListStore::insert/Gtk::ListStore::delete. The reordering of the rows works fine if the dragged row is position on any position except one corner case. If the row is dropped at the end of the TreeView Gtk::ListStore::move fails with this message " Gtk-CRITICAL **: gtk_list_store_move_before: assertion `VALID_ITER (position, store)' failed" Here is my code for my two overriden methods: bool CustomListStore::drag_data_delete_vfunc(const Gtk::TreeModel::Path& path) { Gtk::TreeModel::iterator dest, source; dest = get_iter(destination); source = get_iter(path); move(source, dest); destination.clear(); return true; } bool CustomListStore::drag_data_received_vfunc(const Gtk::TreeModel::Path& dest, const Gtk::SelectionData& selection_data) { destination = dest; return true; } received_vfunc always gets called before the delete_vfunc. Maybe, in my corner case, the Gtk::TreeModel::Path returned in the received_vfunc is not correct? How should I proceed to solve my corner case? |