[wxPython] Finding wxTreeItemId from data associated to a wxTreeItemData
I've been browsing through the list archive and haven't found anything.
Is there an "easy / existing" way of getting a wxTreeItemId from a reference
to data that was associated to a wxTreeItemData?
i.e treeItem = findData(wxTree, data)
Otherwise, I assume I will have the search the tree for the matching data
using something like to following:
Start at top of tree
Look at children <--- recursion?
data = self.tree.GetPyData(treeItem)
if data is goodData:
# found it, do something with the treeItem
What I'm trying to do is append items to a tree. The tree is a
representation of a list of objects that can contain lists of objects, and
so on. (as far as I know, this is only limited by memory). I need to update
the tree when the list changes, but I do not know what the treeItemId is and
I do not want to store the treeItemId with the real data.
My other option is to remove all items from the tree and then rebuild it
using the updated list. I'm not worried about speed so much as I'm worried
about display flicker (It makes it look slow)