GNOME Bugzilla – Bug 577986
Gtk::TreeView::set_drag_dest_row() does not allow passing a NULL TreePath
Last modified: 2011-09-06 04:29:56 UTC
Gtk::TreeView::set_drag_dest_row() does not allow passing a NULL TreePath In plain Gtk, gtk_tree_view_set_drag_dest_row() does allow passing a NULL treepath, but in C++ it requires a reference. Solution: implement an overloaded version that does not take the Gtk::TreePath parameter.
That would be quite easy to do - but what's the outcome? From the code, it seems that that calling set_drag_dest_row() with NULL would be the same then unset_rows_drag_dest() or am I wrong here? Gtk+ documentation just says that you can pass NULL but not what this means.
Passing a NULL TreeIter means "no dest row". This allow proper feedback in the UI. See, for example, in http://git.gnome.org/cgit/gnote/tree/src/notebooks/notebookstreeview.cpp where I had to resort using the C API. Passing an invalid TreeIter does not cut it.
Created attachment 133287 [details] [review] Add a method overload to be able to path NULL path This patch adds the overload to be able to pass a NULL GtkTreePath* to set_drag_dest_row(). Suggestions for a better documentation welcome!
The C API needs to be documented: http://library.gnome.org/devel/gtk/unstable/GtkTreeView.html#gtk-tree-view-set-drag-dest-row (Johannes, please at least file a bug for that, or maybe a patch.) If this really does "unset" something then the function should be called unset_*() instead, as we've done elsewhere. But I don't understand what this function does at all, so I can't decide if that makes sense.
Fixed in this commit: http://git.gnome.org/browse/gtkmm/commit/?id=981388bd3268514b177e742d3bc7f6a0e20d52cd now that the C documentation states that it unsets.