GNOME Bugzilla – Bug 690678
"gtk_tree_drag_source_drag_data_get" needs (inout) annotation for GtkSelectionData argument
Last modified: 2013-01-30 08:15:44 UTC
Created attachment 232153 [details] Test case that shows that the amount of arguments is incorrect Hello, I'm working on a Sugar's Journal bug related with Drag N Drop on a Gtk.TreeView with an own model[1]. We have overridden the "drag_data_get" method of Gtk.TreeDragSource class (from where our own model inheritances) and we are receiving an error with the amount of argument that this method receives. I checked the Gtk3 documentation[2] and I understand that the "path" AND the "selection_data" are passed by argument as it was in the gtk2 version[3]. So, I think there is a bug on the Python Bindings regarding this method. I'm attaching an example that shows the issue that I'm dealing with. Can anybody help me with that? [1] http://bugs.sugarlabs.org/ticket/3999 [2] http://developer.gnome.org/gtk3/3.6/gtk3-GtkTreeView-drag-and-drop.html#gtk-tree-drag-source-drag-data-get [3] http://www.pygtk.org/docs/pygtk/class-gtktreedragsource.html#method-gtktreedragsource--drag-data-get
Hi, The vfunc for Gtk.TreeDragSource.drag_data_get is annotated as an out only argument. So you need to create the instance of the Gtk.SelectionData and return it. See: https://live.gnome.org/PyGObject/IntrospectionPorting#Output_arguments However, based on the docs for that function and your code, it seems that the argument should be marked with an (inout) annotation.
I have tried changing to (inout) but didn't works (the application crash). Also tried (out caller-allocates) but didn't work neither. We are trying to implement the method do_drag_data_get in our custom treemodel implemented in python. http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/journal/listmodel.py#line238 (This code worked with the old bindings)
There might also be a pygobject bug once the inout part of gtk is fixed. Do you have a simple example which shows this?
(In reply to comment #3) > Do you > have a simple example which shows this? Yes, it's attached to the first comment. Here is the link: * https://bugzilla.gnome.org/attachment.cgi?id=232153 Thanks and I hope it helps.
*** This bug has been marked as a duplicate of bug 692844 ***