]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
Make wxBase compiled for wxMotif compatible with wxbase compiled
[wxWidgets.git] / src / generic / treectlg.cpp
index 91ade19789ad508c96a0bd5ace546753533ac139..15d66030199128a5d72ce56041316250e81c1a77 100644 (file)
@@ -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();
@@ -1931,7 +1932,7 @@ void wxGenericTreeCtrl::SelectItem(const wxTreeItemId& itemId, bool select)
 {
     if ( select )
     {
-        DoSelectItem(itemId);
+        DoSelectItem(itemId, !HasFlag(wxTR_MULTIPLE));
     }
     else // deselect
     {