Re: Gnome "Quit" menu is like clicking a button in a wxPython modal dialog

Matthias Brennwald <[email protected]> Mon, 14 Dec 2020 22:07:41 +0100
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>

On Mon, Dec 14, 2020 at 20:43, Dietmar Schwertberger 
<[email protected]> wrote:
> 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.

Oh man, THAT explains a lot. Thanks for pointing out this stupid 
mistake to me. Your explanation totally solves my issue.


-- 
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/TCLCLQ.AVP4YDNLITIW%40gmail.com.