diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 948d9878fa..3a83d4f057 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -1481,9 +1481,10 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text, int image, int selectedImage, wxTreeItemData *data) { - if ( HasFlag(wxTR_HIDE_ROOT) ) { + wxASSERT_MSG( !m_pVirtualRoot, _T("tree can have only a single root") ); + // create a virtual root item, the parent for all the others wxTreeItemParam *param = new wxTreeItemParam; param->SetData(data);