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 690678 - "gtk_tree_drag_source_drag_data_get" needs (inout) annotation for GtkSelectionData argument
"gtk_tree_drag_source_drag_data_get" needs (inout) annotation for GtkSelectio...
Status: RESOLVED DUPLICATE of bug 692844
Product: gtk+
Classification: Platform
Component: .General
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-12-23 17:48 UTC by Manuel Kaufmann
Modified: 2013-01-30 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case that shows that the amount of arguments is incorrect (4.33 KB, text/x-python)
2012-12-23 17:48 UTC, Manuel Kaufmann
Details

Description Manuel Kaufmann 2012-12-23 17:48:15 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
Comment 1 Simon Feltman 2012-12-24 00:28:13 UTC
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.
Comment 2 Gonzalo Odiard 2012-12-29 05:58:14 UTC
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)
Comment 3 Simon Feltman 2012-12-30 20:56:09 UTC
There might also be a pygobject bug once the inout part of gtk is fixed. Do you have a simple example which shows this?
Comment 4 Manuel Kaufmann 2013-01-21 12:25:35 UTC
(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.
Comment 5 Simon Feltman 2013-01-30 08:15:44 UTC

*** This bug has been marked as a duplicate of bug 692844 ***