I’m having a little trouble tracking down the solution
to this problem. Whenever a tree item with an italic font is in my tree, I get
the following error when I start dragging:
Traceback (most recent call last):
File
“C:\Python25\lib\site-packages\wx-2.8-msw-unicode\wx_core.py”, line
14554, in
lambda event: event.callable(*event.args,
**event.kw) )
File “D:\Documents and
Settings\rickkylw\Desktop\pyswigtest.py”, line 72, in DoDragDrop
dd.setObject(self.drag_data)
File “D:\Documents and
Settings\rickkylw\Desktop\pyswigtest.py”, line 15, in setObject
self.SetData(cPickle.dumps(obj))
File “C:\Python25\lib\copy_reg.py”, line
69, in _reduce_ex
raise TypeError, "can't pickle %s
objects" % base.name
TypeError: can’t pickle PySwigObject objects
See the attached example. To reproduce, try to drag the
child node. This will work fine. Now expand child and try to drag something
else and the error occurs. If Child is collapsed again, dragging works.
I’ve been trying to track this down for quite some
time and I just now discovered the cause of this. I’m using Windows XP
with Python 2.5 and wxpython 2.8.8.0.
Any help would be greatly appreciated.
-Kyle Rickey
tree_drag_test.py (2.22 KB)