diff --git a/clientgui/sg_BoincSimpleFrame.cpp b/clientgui/sg_BoincSimpleFrame.cpp index f2f7bfdbab..7de2141030 100644 --- a/clientgui/sg_BoincSimpleFrame.cpp +++ b/clientgui/sg_BoincSimpleFrame.cpp @@ -118,6 +118,9 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position CreateMenus(); dlgMsgsPtr = NULL; m_pBackgroundPanel = new CSimpleGUIPanel(this); + mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->Add(m_pBackgroundPanel, 1, wxLEFT | wxRIGHT | wxEXPAND, 0); + SetSizerAndFit(mainSizer); RestoreState(); } @@ -1006,7 +1009,6 @@ CSimpleGUIPanel::CSimpleGUIPanel(wxWindow* parent) : Layout(); SetSizerAndFit(mainSizer); - parent->SetSizerAndFit(mainSizer); SetBackgroundBitmap(); @@ -1034,8 +1036,6 @@ CSimpleGUIPanel::~CSimpleGUIPanel() delete checkForNewNoticesTimer; m_bmpBg = wxNullBitmap; // Deletes old bitmap via reference counting - GetParent()->SetSizer(NULL, false); // Avoid trying to delete mainSizer twice - wxLogTrace(wxT("Function Start/End"), wxT("CSimpleGUIPanel::CSimpleGUIPanel - Destructor Function End")); } diff --git a/clientgui/sg_BoincSimpleFrame.h b/clientgui/sg_BoincSimpleFrame.h index ba1950b30b..ef151e68a2 100644 --- a/clientgui/sg_BoincSimpleFrame.h +++ b/clientgui/sg_BoincSimpleFrame.h @@ -153,6 +153,7 @@ protected: private: CDlgMessages* dlgMsgsPtr; + wxBoxSizer* mainSizer; DECLARE_EVENT_TABLE() };