how to pickle treectrl?

The way I've handled this is that the data associated with each tree node
(wxTreeCtrl::SetPyData()/GetPyData())contains a List of its children
objects. So the wxPyData object associated with the root of the wxTreeCtrl
(and each of the tree nodes) knows who its child wxPyData objects are, and
each of those children, in turn, knows who _their_ child wxPyData objects
are, and so on. When it comes time to drag and drop a node, I stick the
wxPyData object associated with the node I'm dragging into a Dictionary as
the value, while its key is its wxTreeCtrl text label. All I actually
pickle is this text label. When I drop the item on the target (which has,
or can get, a reference to the dictionary), I unpickle the text label and
use it to retrieve the wxPyData obj from the dictionary. Then I re-build
the applicable part of the tree based on the wxPyData obj and its children.

Paul Gardella
BBN Technologies

ยทยทยท

-----Original Message-----
From: Bert Marco Schuldes [mailto:bert@schuldes.org]
Sent: Monday, September 29, 2003 8:37 AM
To: wxPython-users@lists.wxwindows.org
Subject: [wxPython-users] how to pickle treectrl?

Hallo,

I am pretty new to python and wxwindows.

I tried in vain to pickle a wxtreectl with
children and subchildren and data associated
to each node.

a simple dump(tree, file) does not do the trick.

is there any simple solution for this problem?

Thank you,

Marco

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org