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 652235 - TreeView.enable_model_drag_source() stopped working on Windows
TreeView.enable_model_drag_source() stopped working on Windows
Status: RESOLVED DUPLICATE of bug 616544
Product: pygtk
Classification: Bindings
Component: gtk
2.23.x
Other Windows
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-09 21:48 UTC by Steven T. Snyder
Modified: 2011-09-19 11:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Steven T. Snyder 2011-06-09 21:48:24 UTC
At some point, TreeView.enable_model_drag_source() stopped working on Windows. Since I only use PyGTK, I don't know if this is a general GTK+ problem or just with the Python bindings.

Drag and drop doesn't work in the tutorial example on Windows with PyGTK 2.24:
http://www.pygtk.org/pygtk2tutorial/examples/treeviewdnd.py

However, if I change enable_model_drag_source() to drag_source_set(), drag and drop works (note: it copies the line instead of moves it, but that may be another bug or just a bad script).

Note that you'll need to modify the code in treeviewdnd.py to automatically populate the liststore with some data, since interapp drag and drop doesn't seem to work on Windows, thus preventing you from populating the list manually. You can add the following to __init__ as suggested by Giuseppe Penone on the PyGTK mailing list:

 self.liststore.append(["line 1"])
 self.liststore.append(["line 2"])
 self.liststore.append(["line 3"])
 self.liststore.append(["line 4"])

See the thread on the mailing list here:
http://www.daa.com.au/pipermail/pygtk/2011-January/019323.html

The code in Dieter link (http://git.gnome.org/browse/pygtk/tree/examples/gtk/treeview_dnd.py) works because it uses drag_source_set() and drag_dest_set() instead of TreeView.enable_model_drag_source() and TreeView.enable_model_drag_dest().

I discovered the problem not through the example linked above, but because one of my applications no longer works. I haven't run it for awhile so I don't know what version of GTK+/Pygtk broke it. I have now changed enable_model_drag_source() calls to drag_source_set() instead and it works again.
Comment 1 Dysmas 2011-07-25 13:06:54 UTC
This bug affects TreeView and IconView in Python. I just know that in 2.12 it worked, and in 2.20 and later it no longer works. 
As stated above, drag_source_set and drag_dest_set is still working. 

Tested on Windows XP SP3 with Python-Gtk bundle 2.24
Comment 2 Dieter Verfaillie 2011-07-25 16:55:10 UTC
This is most likely related to GTK+ bug #641924, but I don't have
time to properly investigate right now. In the mean time, could you
try and see what happens with an updated GTK+ 2.24.5 and report back?

There's a suitable gtk+-bundle here (but no updated aio installer yet):
https://github.com/dieterv/legacynativebuilds/downloads

Thanks,
Dieter
Comment 3 Steven T. Snyder 2011-07-25 18:00:23 UTC
I tested it with the gtk 2.24.5 bundle from Dieter's link. Unfortunately the behavior is unchanged; drag and drop is still not functional when using enable_model_drag_source(), but works fine with drag_source_set().
Comment 4 Dieter Verfaillie 2011-09-19 11:06:30 UTC

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