]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed crashing bug when trying to set colours too soon
authorRobin Dunn <robin@alldunn.com>
Wed, 11 Aug 2004 22:21:05 +0000 (22:21 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 11 Aug 2004 22:21:05 +0000 (22:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp

index e56bb68aa4f80546e89f41ff495c396f2e001927..8070a23c1884db1e04d9d0afefe9100b4179cc82 100644 (file)
@@ -4909,10 +4909,16 @@ wxTreeItemId wxTreeListCtrl::FindItem (const wxTreeItemId& item, const wxString&
 { return m_main_win->FindItem (item, str, flags); }
 
 bool wxTreeListCtrl::SetBackgroundColour(const wxColour& colour)
-{ return m_main_win->SetBackgroundColour(colour); }
+{ 
+    if (!m_main_win) return false;
+    return m_main_win->SetBackgroundColour(colour); 
+}
 
 bool wxTreeListCtrl::SetForegroundColour(const wxColour& colour)
-{ return m_main_win->SetForegroundColour(colour); }
+{ 
+    if (!m_main_win) return false;
+    return m_main_win->SetForegroundColour(colour); 
+}
 
 size_t wxTreeListCtrl::GetColumnCount() const
 { return m_main_win->GetColumnCount(); }