title: How to Correctly Remove All elements(including wxsizers and wxwindows) from inside a wxBoxSizer(wxVERTICAL)
body: <p>Hi i am trying to remove all elements(including wxSizers and wxWindows) from inside a wxBoxSizer(wxVERTICAL) . The hierarchy structure I am using is shown in the screenshot below.</p>
  <ol>
  <li>wxBoxSizer(wxVERTICAL) : this contains everything and i want to remove everything inside this sizer. Let's call this sizer the mainSizer.</li>
  <li>wxPanel: Let's call this elementPanel</li>
  <li>wxBoxSizer(wxVERTICAL): this contains the horizontal sizer in step 4</li>
  <li>wxBoxSizer(wxHORIZONTAL): this contains both wxStaticText and the horizontal spacer</li>
  <li>wxStaticText that holds the text I want to display</li>
  <li>wxBoxSizer(wxHORIZONTAL): This is the horizontal spacer of fixed width.</li>
  </ol>
  <p>Note that there are two more vertical spacers that are placed above and below the statictext to make the static text vertically centered but I have not shown them in the diagram.</p>
  <p>I have exactly one mainSizer and many such elementPanels vertically placed, as the containing mainSizer is vertical.  Now I want to remove all the vertically placed elementPanels(and everything inside it) from the mainSizer. How can I achieve this? And does a wxsizer have an id associated with it? If not, how can i find this particular mainSizer from another part of the program so that i can remove everything inside of it. That is, I want to remove all the elementPanels(and everything inside) that I added in the mainSizer but do not delete the mainSizer itself.</p>
  <p>I guess i can have the mainSizer inside a wxPanel and use its id to get to the mainSizer. But still the problem remains how can i delete every child(including sizer and wxWindow) from the mainSizer?</p>
  <p><a href="https://i.stack.imgur.com/nEZdQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nEZdQ.png" alt="mainSizer" /></a></p>