X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/242ec2f7e9e964025400a72581dfa9762850e98b..54e18afcca6b75bfaf9dd1f12f4a255df8ae089d:/samples/widgets/spinbtn.cpp?ds=sidebyside 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,