From 867f2ca48e6c653ed3f1c29677e283428bcf90c3 Mon Sep 17 00:00:00 2001 From: Kevin Hock Date: Fri, 29 Jul 2005 13:20:17 +0000 Subject: [PATCH] Do not try to expand the root node in SetWindowStyle if the root node hasn't been created yet [ bug 1247413 ] git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/treectlg.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index bdd3003ec1..15d6603019 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -896,7 +896,8 @@ wxGenericTreeCtrl::GetChildrenCount(const wxTreeItemId& item, void wxGenericTreeCtrl::SetWindowStyle(const long styles) { - if (!HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT)) + // Do not try to expand the root node if it hasn't been created yet + if (m_anchor && !HasFlag(wxTR_HIDE_ROOT) && (styles & wxTR_HIDE_ROOT)) { // if we will hide the root, make sure children are visible m_anchor->SetHasPlus(); -- 2.45.2