I’m trying to implement drag and drop on a wx.TreeCtrl and I need to handle both
“copy” and “move” operations (if the user keeps CTRL pressed).
First of all, I searched the wiki for an example and I’m confused as
to which method to use.. Should I use DropSource/DropTarget or just
handle EVT_TREE_BEGIN_DRAG and EVT_TREE_END_DRAG?
If the latter, how can I tell if the user is requesting a “move”
operation?
(wxPython 2.8.9.1 on Ubuntu Jaunty)
Reading the relevant paragraph from Cross-Platform GUI Programming with wxWidgets gave me the necessary insight to solve the issue 🙂
In the end I went for the first solution (DropSource/DropTarget), so:
(The second bind avoids a mysterious “window that captured the mouse didn’t process wxEVT_MOUSE_CAPTURE_LOST” on dragging)