From: Vadim Zeitlin Date: Sat, 26 Aug 2006 22:21:11 +0000 (+0000) Subject: don't call EnsureVisible(tree->GetRootItem()) for a tree with hidden root, this crash... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/23c2b62bb4ff8559472e63839a62b30e8d073359?ds=inline don't call EnsureVisible(tree->GetRootItem()) for a tree with hidden root, this crashes under MSW git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40855 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 3e17c1ae5e..440cbcf32e 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -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 }