diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 89bda1e810..8377d92ca4 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -249,6 +249,13 @@ MyFrame::~MyFrame() } void MyFrame::OnSize(wxSizeEvent& event) +{ + DoSize(); + + event.Skip(); +} + +void MyFrame::DoSize() { if ( !m_logWindow ) return; @@ -257,8 +264,6 @@ void MyFrame::OnSize(wxSizeEvent& event) wxCoord y = (2*size.y)/3; m_listCtrl->SetSize(0, 0, size.x, y); m_logWindow->SetSize(0, y + 1, size.x, size.y - y); - - event.Skip(); } void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) @@ -365,9 +370,7 @@ void MyFrame::RecreateList(long flags, bool withText) } } -#ifdef __WXMSW__ - SendSizeEvent(); -#endif + DoSize(); m_logWindow->Clear(); } diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h index 0fafad7b75..97a719b7dc 100644 --- a/samples/listctrl/listtest.h +++ b/samples/listctrl/listtest.h @@ -80,7 +80,9 @@ class MyFrame: public wxFrame { public: MyFrame(const wxChar *title, int x, int y, int w, int h); - ~MyFrame(); + virtual ~MyFrame(); + + void DoSize(); protected: void OnSize(wxSizeEvent& event);