What would you recommend in terms of removing controls from a wx.Panel ? I have a list of dicts of controls, something like:
[ 'cb': wx.CheckBox, 'label': wx.StaticText, 'input': wx.TextCtrl ]
and I am trying to remove them when something happens so I can add new ones.
The way I do it is:
# remove previous controls
for c in self.controls:
c['cb'].Destroy()
c['label'].Destroy()
c['input'].Destroy()
self.controls.remove(c)
but it seems that I always end up having len(self.controls) > 0 for an unknown reason
So what's the proper way of removing controls from a panel? Should I do something else on the panel that holds the controls?