+
+void MyFrame::OnCreateLbox(wxCommandEvent& WXUNUSED(event))
+{
+ for ( size_t n = 0; n < NUM_LBOXES; n++ )
+ {
+ m_lboxes.Add(new wxListBox(this, -1, wxPoint(m_pos, m_pos)));
+ m_pos += POS_STEP;
+ }
+}
+
+void MyFrame::OnDeleteLbox(wxCommandEvent& WXUNUSED(event))
+{
+ size_t count = m_lboxes.GetCount();
+ if ( count < NUM_LBOXES )
+ return;
+
+ for ( size_t n = 0; n < NUM_LBOXES; n++ )
+ {
+ delete m_lboxes[--count];
+ m_lboxes.RemoveAt(count);
+
+ m_pos -= POS_STEP;
+ }
+}
+