Re: Gnome "Quit" menu is like clicking a button in a wxPython modal dialog
Dietmar Schwertberger <[email protected]> Mon, 14 Dec 2020 20:43:42 +0100
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On 13.12.2020 22:59, Matthias Brennwald wrote: > - The MessageDialog gets closed with a "yes" answer, and the program > starts running the Warmup step (thread B), although the user did not > give a "yes" or "no" answer. You're not testing for wx.ID_YES, only for being not wx.ID_NO: if result == wx.ID_NO: ... else: ... Just test for result being one of these: wx.ID_YES, wx.ID_NO, wx_ID_CANCEL. If it's ID_CANCEL and you receive EVT_CLOSE, then it was the Quit menu. Otherwise it was Escape. Regards, Dietmar -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/1ff37d52-79d3-a729-12d6-a3a05a8387ec%40schwertberger.de.