Drag and drop: PyDataObjectSimple

If anyone able to point me at an example which uses wx.PyDataObjectSimple with a CustomDataFormat please?

I have attempted to explore the use of PyDataObjectSimple as described in http://www.wxpython.org/docs/api/wx.PyDataObjectSimple-class.html by playing around with the Custom Drag and Drop sample in the wxPython demo.

However, when I replicate that example and use it in the demo code instead of its CustomDataObject and DataObjectComposite, the call self.GetData() fails to copy anything from the DropSource object to the DropTarget. The cursor performs as expected, switching its appearance on entry to the target box, and as far as I can see from examining the format IDs, the source and target objects match.

The documentation is pretty clear that in order to overload functions effectively you need to use PyDataObjectSimple.

   Hugh Kernohan

Hugh Kernohan wrote:

If anyone able to point me at an example which uses wx.PyDataObjectSimple with a CustomDataFormat please?

I have attempted to explore the use of PyDataObjectSimple as described in wxPython API Documentation — wxPython Phoenix 4.2.2 documentation by playing around with the Custom Drag and Drop sample in the wxPython demo.

However, when I replicate that example and use it in the demo code instead of its CustomDataObject and DataObjectComposite, the call self.GetData() fails to copy anything from the DropSource object to the DropTarget. The cursor performs as expected, switching its appearance on entry to the target box, and as far as I can see from examining the format IDs, the source and target objects match.

Can you send me your version of the code to test with? Also, what platform are you on?

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!