]> git.saurik.com Git - wxWidgets.git/commitdiff
don't call EnsureVisible(tree->GetRootItem()) for a tree with hidden root, this crash...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 26 Aug 2006 22:21:11 +0000 (22:21 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 26 Aug 2006 22:21:11 +0000 (22:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/widgets/widgets.cpp

index 3e17c1ae5e6b94ef67254108a12e1a824ef68ed5..440cbcf32e10bac5a98a81f516c17abe8edfd8d7 100644 (file)
@@ -578,7 +578,9 @@ void WidgetsFrame::InitBook()
 
     // but ensure that the top of the tree is shown nevertheless
     wxTreeCtrl * const tree = m_book->GetTreeCtrl();
-    tree->EnsureVisible(tree->GetRootItem());
+
+    wxTreeItemIdValue cookie;
+    tree->EnsureVisible(tree->GetFirstChild(tree->GetRootItem(), cookie));
 #endif // USE_TREEBOOK
 }