Ron Griswold wrote:
Hi Folks,
I'm having a problem with my app where the process seems to hang on exit
if I have displayed a custom dialog box (my own class derived from
wx.Dialog). It seems like the dialog is starting a thread that isn't
exiting.Here's the sequence of events:
1) from cmd line launch app
2) in app open my dialog (ShowModal)
3) close dialog (EndModal, dialog closes fine and control is restored to
the app)
4) close app (command prompt is not returned, I have to ctl-C to kill
it)I have checked this on Win32, Linux and OSX; all three exhibit the same
behavior so it wouldn't appear to be platform related.Is it something I'm doing (or more likely, not doing),
You forgot to Destroy() the dialog. When it closes it is not automatically destroyed like frames are because they need to continue to exist for you to be able to get the data out of them. Because of some implementation details to make other things work better, I am unable to rely on the Python proxy for the dialog going out of scope to destroy the C++ dialog object, so you have to do it yourself. If you don't call dialog.Destroy() then the C++ object still exists and so MainLoop doesn't exit because there are still top-level windows.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!