code: def traverse(self, traverseroot, function, cookie=0):
          
          if self.tree.ItemHasChildren(traverseroot):
              firstchild, cookie = self.tree.GetFirstChild(traverseroot)
              function(firstchild)
              self.traverse(firstchild, function, cookie)
  
          child = self.tree.GetNextSibling(traverseroot)
          if child:
              function(child)
              self.traverse(child, function, cookie)
docs: recursivly walk tree control