killing an wx.app

Robin

Thanks.

I'm trying to get the dialog so I call
wx.App.GetTopWindow() but it returns the same dialog
on the second call even after I've dlg.EndModal(2) and
dlg.Destroy() the first dialog so I can't find a
second dialog.

Nigel

···

--- Robin Dunn <robin@alldunn.com> wrote:

Nigel W. Moriarty wrote:
> Folks
>
> I have a python application that starts an
instance of
> wx.App in a thread with a MainLoop using
> Pending/Dispatch so I can stop it by setting an
> attribute of the wx.App class. Before I start the
> MainLoop I run a method of the wx.App that creates
a
> wx.Dialog with parent = None.
>
> When I exit the MainLoop, the wx.Dialog remains
active
> and responds to events. Why and how do I kill the
> wx.App without kill my python app.

Modal dialogs have their own event loop so you'll
need to call
dialog.EndModal to get it to exit.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax
with wxPython!

---------------------------------------------------------------------

To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org

---
Nigel W. Moriarty, \alphabet_soup

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

Nigel W. Moriarty wrote:

Robin

Thanks.

I'm trying to get the dialog so I call
wx.App.GetTopWindow() but it returns the same dialog
on the second call even after I've dlg.EndModal(2) and
dlg.Destroy() the first dialog so I can't find a
second dialog.

There will need to be an iteration of the MainLoop before the Destroy actually results in the destruction of the dialog and having it remove itself from the internal top-level window list.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!