From 55ab5200fb1bb55712b0f24ad5e4a923c74e5f94 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 14 Sep 2008 19:53:31 +0000 Subject: [PATCH] delete the old labels when recreating the spin controls git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/widgets/spinbtn.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index 3f1ebdbc5f..8f89806646 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -314,19 +314,7 @@ void SpinBtnWidgetsPage::CreateSpin() val = valOld; } - m_sizerSpin->Detach( m_spinbtn ); - m_sizerSpin->Detach( m_spinctrl ); - m_sizerSpin->Detach( m_spinctrldbl ); - - // there are 4 spacers left - m_sizerSpin->Remove( 0 ); - m_sizerSpin->Remove( 0 ); - m_sizerSpin->Remove( 0 ); - m_sizerSpin->Remove( 0 ); - - delete m_spinbtn; - delete m_spinctrl; - delete m_spinctrldbl; + m_sizerSpin->Clear(true /* delete windows */); } m_spinbtn = new wxSpinButton(this, SpinBtnPage_SpinBtn,