]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/tool/OutlineService.py
Patch from Davide Salomoni that adds an optional point
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / OutlineService.py
index 858fbade75b3d1c772de4acf2be3135b097eaa70..c04f1ecc1f5a7e6318de62c158c653a93a67eb2b 100644 (file)
@@ -156,11 +156,8 @@ class OutlineView(Service.ServiceView):
                 treeCtrl.Expand(child)
             (child, cookie) = treeCtrl.GetNextChild(parentItem, cookie)
 
-        # wxBug: This causes a crash, tried using ScrollTo which crashed as well.  Then tried calling it with wx.CallAfter and that crashed as well, with both EnsureVisible and ScrollTo
-        # self.GetControl().EnsureVisible(self.GetControl().GetRootItem())
-        # So doing the following massive hack which forces the treectrl to scroll up to the top item
-        treeCtrl.Collapse(parentItem)
-        treeCtrl.Expand(parentItem)
+        if parentItem:
+            treeCtrl.EnsureVisible(parentItem)
 
 
 class OutlineTreeCtrl(wx.TreeCtrl):