Search code examples
pythonwxpython

python deepcopy of wx object


I have a wx.TreeCtrl and want to make a real copy of it. I've tried it with

    CopyOfTree = copy.deepcopy(self.myTreeCtrl)

but this doesn't work. Is there a way to deep copy the TreeCtrl?


Solution

  • You should check out the PersistenceManager. It allows you to save the widget's properties to make restoring it easier:

    You can see an example in the wxPython demo under PersistentControls