]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/widgets/spinbtn.cpp
allow the user to pass NULL for the status widths; this was a feature supported by...
[wxWidgets.git] / samples / widgets / spinbtn.cpp
index 3f1ebdbc5f08e9b48289f7f5ee586608c9393a5d..8f8980664604a48807d449fb3a3a001d09aa85d0 100644 (file)
@@ -314,19 +314,7 @@ void SpinBtnWidgetsPage::CreateSpin()
             val = valOld;
         }
 
             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,
     }
 
     m_spinbtn = new wxSpinButton(this, SpinBtnPage_SpinBtn,