After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 577986 - Gtk::TreeView::set_drag_dest_row() does not allow passing a NULL TreePath
Gtk::TreeView::set_drag_dest_row() does not allow passing a NULL TreePath
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: TreeView
2.16.x
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on: 581435
Blocks:
 
 
Reported: 2009-04-05 08:13 UTC by Hubert Figuiere (:hub)
Modified: 2011-09-06 04:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a method overload to be able to path NULL path (2.21 KB, patch)
2009-04-25 08:48 UTC, Johannes Schmid
none Details | Review

Description Hubert Figuiere (:hub) 2009-04-05 08:13:22 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.
Comment 1 Johannes Schmid 2009-04-22 07:34:23 UTC
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.
Comment 2 Hubert Figuiere (:hub) 2009-04-22 08:13:46 UTC
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.
Comment 3 Johannes Schmid 2009-04-25 08:48:22 UTC
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!
Comment 4 Murray Cumming 2009-05-01 11:54:41 UTC
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.
Comment 5 Murray Cumming 2011-09-06 04:29:56 UTC
Fixed in this commit:
  http://git.gnome.org/browse/gtkmm/commit/?id=981388bd3268514b177e742d3bc7f6a0e20d52cd
now that the C documentation states that it unsets.