Forgive me if I have overlooked something, but I have been searching and experimenting for hours.
I have a treectrl that has over 1000 items and would like to be able to save the ID or relative address of last selected item to a file so it can be retrieved when the app is opened again. TreeItemId seems to only be the ID that resides in memory while the app is runing, not an ID relative to the root. Is there a way I can do this?
Forgive me if I have overlooked something, but I have been searching and experimenting for hours.
I have a treectrl that has over 1000 items and would like to be able to save the ID or relative address of last selected item to a file so it can be retrieved when the app is opened again. TreeItemId seems to only be the ID that resides in memory while the app is runing,
Correct, it is a runtime-only reference to the node in the UI tree.
not an ID relative to the root. Is there a way I can do this?
Not with TreeCtrl. What you probably want is a way to record which node in your data is the current one, rather than the current tree item. (IOW, data model vs. the view.) If you're not doing it already you can store a reference to a python object with each item in the tree control. If you use that to make a connection between the tree items to your data then that will be an easy way to track a current item in your data model.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!