X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bbf7159c8211a398e573122c66b93722f5125c60..4809f5df5d38a5d8068c7857e295a4ed22b8659c:/wxPython/samples/ide/activegrid/tool/OutlineService.py diff --git a/wxPython/samples/ide/activegrid/tool/OutlineService.py b/wxPython/samples/ide/activegrid/tool/OutlineService.py index 858fbade75..c04f1ecc1f 100644 --- a/wxPython/samples/ide/activegrid/tool/OutlineService.py +++ b/wxPython/samples/ide/activegrid/tool/OutlineService.py @@ -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):