return
treeCtrl = self.GetControl()
+
parentItem = treeCtrl.GetRootItem()
+ if not parentItem:
+ return
+
if expanded[0] != treeCtrl.GetItemText(parentItem):
return
treeCtrl.Expand(child)
(child, cookie) = treeCtrl.GetNextChild(parentItem, cookie)
- if parentItem:
- treeCtrl.EnsureVisible(parentItem)
+ treeCtrl.EnsureVisible(parentItem)
class OutlineTreeCtrl(wx.TreeCtrl):
if self.ItemHasChildren(item):
child, cookie = self.GetFirstChild(item)
- while child and child.IsOk():
+ while child.IsOk():
self.FindDistanceToTreeItems(child, position, distances, items)
child, cookie = self.GetNextChild(item, cookie)
return False