[pygtk] Why do I need to drag rows out of the treeview to make D'n'D work?

François Ingelrest athropos at gmail.com
Fri May 18 23:43:16 WST 2007


Hello everyone,

I am trying, without success, to add drag'n'drop support to one of my
applications. I have read a lot of examples and it seems quite simple
to do, but that does not work for me. For instance, I simply tried to
add these two lines to my code:

self.treeview.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
[("example", 0, 0)], gtk.gdk.ACTION_DEFAULT)
self.treeview.enable_model_drag_dest([("example", 0, 0)],
gtk.gdk.ACTION_DEFAULT)

This comes from a minimal example I found while searching for
information, and that seems to work perfectly in this example, but not
in my application.

What happens is that the drag'n'drop visual feedback does not appear
when I try to move a row in my treeview. I need to drag the row *out*
of the tree, and then the feedback appears. After that I can even drag
it back into the tree, but I really don't understand why I need to
first move it out of the tree.

Any help about this would be welcome,
thanks.


More information about the pygtk mailing list