[wxPython] How to rebuild a page containing controls because some of them have to be deleted?

F. GEIGER f.geiger at vol.at
Fri Oct 29 20:51:31 CEST 2004

I often use Notebook to structure my GUIs. Sometimes I have to provide a
Settings page. Doing changes in this page influences other pages in such a
way, that some controls have to change add or remove children or even have
to be removed from the page at all.

Yet I could not come up with a solid pattern how to do this. I tried to call
DestroyChildren(), delete all ref's to them, and to set the page's sizer to
None. This doesn't work very well. When I rebuild the page, at least the
arrangement of the controls is not the same as before, which makes me think,
that other things will go wrong in the long run too.

For now I issue a dialog telling the user, that he has to restart the app -
not very professional looking...

So, how is this done best?

Kind regards

More information about the Python-list mailing list