python - wx.TreeCtrl drag and drop, copy and move -


I am trying to apply the drag and drop it to wx.TreeCtrl and give me "copy" and " Move "" operation (if the user keeps pressing CTRL).
First of all, I have searched for an example and I am confused to using the method. Do I have drop-source / drop -Target or just handle EVT_TREE_BEGIN_DRAG and EVT_TREE_END_DRAG?
If the latter, how can I tell? Is the user requesting "trick" operation?

(wxPython 2.8.9.1 on Ubuntu County)

  tree. MyDropTarget_LOST, Lambda x: None) tree.bund (wx.EVT_TREE_BEGIN_DRAG, self.on_drag) tree.GetMainWindow () .bind (wx.EVT_MOUSE_CAPTURE_LOST, lambda x: none)  

(The second tie is avoided by a mysterious "window that did not catch the mouse Rocess wxEVT_MOUSE_CAPTURE_LOST" on dragging)

  def on_drag (self, evt): # no evt.Allow ( ) Here, I will not use the TreeDCL's internal DND support item = evt.GetItem () if the item == self.tree.GetRootItem (): Return dropsrc = wx.DropSource (auto) # drops of droplets # drops #droppersops. Dodradrope (wx.Drag_AllowMove)  

Comments