Since you're doing DnD within the same application then I would recommend something similar. I would just put the objects in a dictionary and then put the key in the custom DND data object. When the target receives the data it just needs to use the key to fetch the object.
···
On 11/23/09 5:52 AM, Philip Cavaco wrote:
Hello,
I am using drag and drop from a toolbar to a tree control, within the
same Frame, to create nodes in the tree. To do this I need to pass the
instance of a class containing references to modules which can be
created corresponding to the button selected in the toolbar. I have
created my own PyDataObjectSimple class and have the DropSource and
DropTarget working.The issue is that the class which I need to pass can't be pickled
because of the module references. Is there a way to pass the reference
to the object cleanly using the Drag and Drop mechanisms?In the mean time I am putting the reference in a place where both the
toolbar and control can access, but I would like to avoid this work
around if possible.
--
Robin Dunn
Software Craftsman