From 23c2b62bb4ff8559472e63839a62b30e8d073359 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 26 Aug 2006 22:21:11 +0000 Subject: [PATCH] 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 --- samples/widgets/widgets.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } -- 2.49.0