From da9b415349098352226aa5efc53488a33100d514 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 11 Aug 2004 22:21:05 +0000 Subject: [PATCH] fixed crashing bug when trying to set colours too soon git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp index e56bb68aa4..8070a23c18 100644 --- a/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/wxCode/src/treelistctrl.cpp @@ -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(); }