Destroying Dialogs
Python objects can't own C++ wxWindow dialog objects (they are normally owned by their parent window) and so the
__del__ of the Python instances can't be allowed to invoke the C++ destructor. Thus any wxDialogs or menus without a parent (like pop-ups) that you spawn must be explicitly Destroy()ed.
There are a number of convenience functions associated with wxDialogs that do
not need to be Destroy()ed since the dialog is destroyed inside the funciton. (Good thing, too: you can't call the wxDialog anyway since the convenience methods do not return an instance of the wxDialog..) There is a pretty authoritative
list of wxDialog convenience functions, but a copy of it is:
- wxCreateFileTipProvider
- wxFileSelector
- wxGetColourFromUser
- wxGetNumberFromUser
- wxGetPasswordFromUser
- wxGetTextFromUser
- wxGetMultipleChoice
- wxGetSingleChoice
- wxGetSingleChoiceIndex
- wxGetSingleChoiceData
- wxMessageBox
- wxShowTip
There is another list of dialogs defined in wxPython.lib.dialog.py. They also do not need to be explicitly Destroy()ed. The result of one of these dialog calls is always an instance of DialogResults (which prints nicely in dictionary-esque form).
- alertDialog (variation of messageDialog)
- colorDialog (wxColourDialog)
- colourDialog (wxColourDialog)
- dirDialog (wxDirDialog)
- findDialog (does not map to an underlying wx class -- written from scratch)
- fileDialog (wxFileDialog)
- fontDialog (wxFontDialog)
- messageDialog (wxMessageDialog)
- multipleChoiceDialog (wxMultipleChoiceDialog)
- openFileDialog (wxFileDialog)
- saveFileDialog (wxFileDialog)
- scrolledMessageDialog (wxScrolledMessageDialog)
- singleChoiceDialog (wxSingleChoiceDialog)
- textEntryDialog (wxTextEntryDialog)
--
DuckySherwood - 14 Jul 2003