+
+ def RecreateTree(self, evt=None):
+ self.tree.Freeze()
+ self.tree.DeleteAllItems()
+ self.root = self.tree.AddRoot("wxPython Overview")
+ firstChild = None
+ filter = self.filter.GetValue()
+ for category, items in _treeList:
+ if filter:
+ items = [item for item in items if filter.lower() in item.lower()]
+ if items:
+ child = self.tree.AppendItem(self.root, category)
+ if not firstChild: firstChild = child
+ for childItem in items:
+ theDemo = self.tree.AppendItem(child, childItem)
+ self.treeMap[childItem] = theDemo
+
+ self.tree.Expand(self.root)
+ if firstChild:
+ self.tree.Expand(firstChild)
+ if filter:
+ self.tree.ExpandAll()
+ self.tree.Thaw()
+