Crashed wxPython Phoenix, lightsabers up!

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
I managed to create an app that crashes the latest development version of wxPython Phoenix, that is 3.0.3.dev2828+929a8af-cp36-cp36m-win_amd64 at the time of this writing.

I am running Windows 10 Home, 64-bit version of the OS.

How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.
I am more than willing to give you a demonstration code if you can't imagine the issue at hand. Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Tim Roberts
Boštjan Mejak wrote:
How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But it's not a modal dialog?  Shouldn't it be?

 
But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.

If it were a modal dialog, you should not have been able to fire up another menu at all.

"Killed" in what sense?  You wanted the process to die.  Are you saying you get a crash notice?  What's the complaint?  Deleting something that was already deleted?  When you answer "Yes", what actions do you take?  If the first message box deletes cleans up resources, you can't really be surprised that the second dialog runs into trouble.


Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

Well, that's your opinion.  I find it difficult to call this a "serious" bug.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
Maybe I got my code wrong.

On Fri, Mar 3, 2017 at 9:28 PM Tim Roberts <[hidden email]> wrote:
Boštjan Mejak wrote:
How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But it's not a modal dialog?  Shouldn't it be?

 
But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.

If it were a modal dialog, you should not have been able to fire up another menu at all.

"Killed" in what sense?  You wanted the process to die.  Are you saying you get a crash notice?  What's the complaint?  Deleting something that was already deleted?  When you answer "Yes", what actions do you take?  If the first message box deletes cleans up resources, you can't really be surprised that the second dialog runs into trouble.


Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

Well, that's your opinion.  I find it difficult to call this a "serious" bug.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Chris Barker - NOAA Federal


On Fri, Mar 3, 2017 at 12:35 PM, Boštjan Mejak <[hidden email]> wrote:
Maybe I got my code wrong.

or a bit missing -- this is wierd action on the part of the user -- if you want to support it, then you may need to put a check or two in to make sure that it either can't happen, or it will clean itself up properly.

-CHB

 

On Fri, Mar 3, 2017 at 9:28 PM Tim Roberts <[hidden email]> wrote:
Boštjan Mejak wrote:
How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But it's not a modal dialog?  Shouldn't it be?

 
But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.

If it were a modal dialog, you should not have been able to fire up another menu at all.

"Killed" in what sense?  You wanted the process to die.  Are you saying you get a crash notice?  What's the complaint?  Deleting something that was already deleted?  When you answer "Yes", what actions do you take?  If the first message box deletes cleans up resources, you can't really be surprised that the second dialog runs into trouble.


Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

Well, that's your opinion.  I find it difficult to call this a "serious" bug.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
when I get home from work, can I attact a demonstration code and you see where the problem is?

On 3 Mar 2017, at 22:46, Chris Barker <[hidden email]> wrote:



On Fri, Mar 3, 2017 at 12:35 PM, Boštjan Mejak <[hidden email]> wrote:
Maybe I got my code wrong.

or a bit missing -- this is wierd action on the part of the user -- if you want to support it, then you may need to put a check or two in to make sure that it either can't happen, or it will clean itself up properly.

-CHB

 

On Fri, Mar 3, 2017 at 9:28 PM Tim Roberts <[hidden email]> wrote:
Boštjan Mejak wrote:
How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But it's not a modal dialog?  Shouldn't it be?

 
But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.

If it were a modal dialog, you should not have been able to fire up another menu at all.

"Killed" in what sense?  You wanted the process to die.  Are you saying you get a crash notice?  What's the complaint?  Deleting something that was already deleted?  When you answer "Yes", what actions do you take?  If the first message box deletes cleans up resources, you can't really be surprised that the second dialog runs into trouble.


Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

Well, that's your opinion.  I find it difficult to call this a "serious" bug.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
The attached demo.py file is a demonstration of the problem I was talking about. Is it my code that is faulty or is wxPython's/wxWidgets' or Python's fault?

On Sat, Mar 4, 2017 at 9:06 AM Boštjan Mejak <[hidden email]> wrote:
when I get home from work, can I attact a demonstration code and you see where the problem is?

On 3 Mar 2017, at 22:46, Chris Barker <[hidden email]> wrote:



On Fri, Mar 3, 2017 at 12:35 PM, Boštjan Mejak <[hidden email]> wrote:
Maybe I got my code wrong.

or a bit missing -- this is wierd action on the part of the user -- if you want to support it, then you may need to put a check or two in to make sure that it either can't happen, or it will clean itself up properly.

-CHB

 

On Fri, Mar 3, 2017 at 9:28 PM Tim Roberts <[hidden email]> wrote:
Boštjan Mejak wrote:
How I did it? Well, I made an event in my GUI app where clicking the X button puts up a message dialog to the user, saying "Do you really wanna close this app?" and the "Yes" button destroys the whole object, thus exiting the application.

But it's not a modal dialog?  Shouldn't it be?

 
But now the catch! I also made a taskbar icon which includes a menu item to also exit the application: same message dialog with Yes/No buttons.

Let's crash this baby! If you click the X button and not choosing either "Yes" or "No" but instead have this message dialog wait and in the mean time you right-click the taskbar icon and choose the "Exit" menu item and choose "Yes". Then click another "Yes" of that waiting message dialog and BOOM! Voila, we have killed the wxWidgets/wxPython process.

If it were a modal dialog, you should not have been able to fire up another menu at all.

"Killed" in what sense?  You wanted the process to die.  Are you saying you get a crash notice?  What's the complaint?  Deleting something that was already deleted?  When you answer "Yes", what actions do you take?  If the first message box deletes cleans up resources, you can't really be surprised that the second dialog runs into trouble.


Please bare in mind that this is a serious bug in wxWidgets and wxPython Phoenix.

Well, that's your opinion.  I find it difficult to call this a "serious" bug.
-- 
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            <a href="tel:(206)%20526-6959" value="+12065266959" class="gmail_msg" target="_blank">(206) 526-6959   voice
7600 Sand Point Way NE   <a href="tel:(206)%20526-6329" value="+12065266329" class="gmail_msg" target="_blank">(206) 526-6329   fax
Seattle, WA  98115       <a href="tel:(206)%20526-6317" value="+12065266317" class="gmail_msg" target="_blank">(206) 526-6317   main reception

[hidden email]

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

demo.py (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Tim Roberts
On Mar 4, 2017, at 8:33 AM, Boštjan Mejak <[hidden email]> wrote:
>
> The attached demo.py file is a demonstration of the problem I was talking about. Is it my code that is faulty or is wxPython's/wxWidgets' or Python's fault?

I'm not sure there's a clear answer to that question.  Your design clearly closes a window while an event handler for that window is still executing, thereby pulling the rug out from underneath.  I think a very good argument can be made that you should not do that.  It's not clear how wxWidgets could react to that situation sensibly.

I understand how you might disagree, but if I were the referee in this situation, I'd have to assign the yellow card to you.

Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
Can you propose how should I fix my code?

> On 5 Mar 2017, at 03:46, Tim Roberts <[hidden email]> wrote:
>
>> On Mar 4, 2017, at 8:33 AM, Boštjan Mejak <[hidden email]> wrote:
>>
>> The attached demo.py file is a demonstration of the problem I was talking about. Is it my code that is faulty or is wxPython's/wxWidgets' or Python's fault?
>
> I'm not sure there's a clear answer to that question.  Your design clearly closes a window while an event handler for that window is still executing, thereby pulling the rug out from underneath.  I think a very good argument can be made that you should not do that.  It's not clear how wxWidgets could react to that situation sensibly.
>
> I understand how you might disagree, but if I were the referee in this situation, I'd have to assign the yellow card to you.
> —
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Aw: Re: [wxPython-users] Crashed wxPython Phoenix, lightsabers up!

Karsten Hilbert
> Can you propose how should I fix my code?

You might consider making the dialog modal, as
was already hinted at.

Karsten

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: [wxPython-users] Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
But my dialog is modal, isn't it?

dialog = wx.MessageDialog(parent=self,
                                             caption="Exit Playground",
                                             message="Are you sure to exit Playground?",
                                             style=wx.YES_NO | wx.ICON_QUESTION)

        if dialog.ShowModal() == wx.ID_YES:
            ...

Doesn't the call to ShowModal() make it modal?

On Sun, Mar 5, 2017 at 12:56 PM Karsten Hilbert <[hidden email]> wrote:
> Can you propose how should I fix my code?

You might consider making the dialog modal, as
was already hinted at.

Karsten

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Aw: Re: Re: [wxPython-users] Crashed wxPython Phoenix, lightsabers up!

Karsten Hilbert
But my dialog is modal, isn't it?
 

dialog = wx.MessageDialog(parent=self,
                                             caption="Exit Playground",
                                             message="Are you sure to exit Playground?",
                                             style=wx.YES_NO | wx.ICON_QUESTION)
 
        if dialog.ShowModal() == wx.ID_YES:
            ...
 
Doesn't the call to ShowModal() make it modal? 



That code certainly should make the dialog modal, yes, hence sorry for the noise.

Karsten

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: Re: [wxPython-users] Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
So, what can I do?

On Sun, Mar 5, 2017 at 3:18 PM Karsten Hilbert <[hidden email]> wrote:
But my dialog is modal, isn't it?
 

dialog = wx.MessageDialog(parent=self,
                                             caption="Exit Playground",
                                             message="Are you sure to exit Playground?",
                                             style=wx.YES_NO | wx.ICON_QUESTION)
 
        if dialog.ShowModal() == wx.ID_YES:
            ...
 
Doesn't the call to ShowModal() make it modal? 



That code certainly should make the dialog modal, yes, hence sorry for the noise.

Karsten

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: Re: [wxPython-users] Crashed wxPython Phoenix, lightsabers up!

Vlastimil Brom
2017-03-05 20:03 GMT+01:00 Boštjan Mejak <[hidden email]>:

> So, what can I do?
>
> On Sun, Mar 5, 2017 at 3:18 PM Karsten Hilbert <[hidden email]>
> wrote:
>>
>> But my dialog is modal, isn't it?
>>
>>
>> dialog = wx.MessageDialog(parent=self,
>>                                              caption="Exit Playground",
>>                                              message="Are you sure to exit
>> Playground?",
>>                                              style=wx.YES_NO |
>> wx.ICON_QUESTION)
>>
>>         if dialog.ShowModal() == wx.ID_YES:
>>             ...
>>
>> Doesn't the call to ShowModal() make it modal?
>>
>>
>>
>> That code certainly should make the dialog modal, yes, hence sorry for the
>> noise.
>>
>> Karsten
>>

Hi,
if there is a specific clash with the taskbar icon functionality,
would it be possible to disable the popup menu in the taskbar while
handling the closing dialog?
maybe something like
        self.taskBarIcon.Unbind(wx.EVT_MENU)
in OnMainWindowClose(...)
probably with some additional code to rebind the event handler as needed.

However, I haven't checked for possible drawbacks or cornercases of
such approach.

hth,
  vbr

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Tim Roberts
In reply to this post by Boštjan Mejak-4
On Mar 5, 2017, at 11:03 AM, Boštjan Mejak <[hidden email]> wrote:
>
> So, what can I do?

The brute-force method would be to set a flag while your modal dialog is up, and ignore the task bar action when that flag is set.

I am little confused as to why you are seeing the task bar click while a modal dialog is up, but maybe that window is considered to be owned by someone else.  If so, that would be a Windows usage issue.

Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
I must say that the wx.Dialog.ShowModal() does not work as expected then.

Would you agree? If you actually tried my demo code, you can notice when closing the main window (clicking on the X button) puts up a 'modal' message dialog which allows doing other stuff. This, however, should *not* happen. Please tell this to Robin Dunn to look into this.

I ran my code on Windows 10 (64-bit), Python 3.6 (64-bit), wxPython Phoenix latest snapshot build.

> On 6 Mar 2017, at 08:31, Tim Roberts <[hidden email]> wrote:
>
>> On Mar 5, 2017, at 11:03 AM, Boštjan Mejak <[hidden email]> wrote:
>>
>> So, what can I do?
>
> The brute-force method would be to set a flag while your modal dialog is up, and ignore the task bar action when that flag is set.
>
> I am little confused as to why you are seeing the task bar click while a modal dialog is up, but maybe that window is considered to be owned by someone else.  If so, that would be a Windows usage issue.
> —
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Chris Barker - NOAA Federal
On Mon, Mar 6, 2017 at 11:43 AM, Boštjan Mejak <[hidden email]> wrote:
I must say that the wx.Dialog.ShowModal() does not work as expected then.

Would you agree?

yes and no -- ShowModal should lock up all wxFrames and wxDialogs.

But the taskbar icon is not handled by wx, and it may be very tricky to catch events from that particular source and disable them when there is a Modal Dialog up.

But it's a fine idea to post this as a Bug Report / Feature request -- maybe it's not hard to do -- I have no idea.

It should be posted to the main wxWidgets project -- this is not a wxPython-specific issue.

In the meantime, Tim's "Brute Force" approach may be what you need to do.

-CHB

 


If you actually tried my demo code, you can notice when closing the main window (clicking on the X button) puts up a 'modal' message dialog which allows doing other stuff. This, however, should *not* happen. Please tell this to Robin Dunn to look into this.

I ran my code on Windows 10 (64-bit), Python 3.6 (64-bit), wxPython Phoenix latest snapshot build.

> On 6 Mar 2017, at 08:31, Tim Roberts <[hidden email]> wrote:
>
>> On Mar 5, 2017, at 11:03 AM, Boštjan Mejak <[hidden email]> wrote:
>>
>> So, what can I do?
>
> The brute-force method would be to set a flag while your modal dialog is up, and ignore the task bar action when that flag is set.
>
> I am little confused as to why you are seeing the task bar click while a modal dialog is up, but maybe that window is considered to be owned by someone else.  If so, that would be a Windows usage issue.
> —
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
I've posted a bug report on wxWidgets' Trac site and I hope someone will take it seriously and fix this thing.

On 6 Mar 2017, at 20:51, Chris Barker <[hidden email]> wrote:

On Mon, Mar 6, 2017 at 11:43 AM, Boštjan Mejak <[hidden email]> wrote:
I must say that the wx.Dialog.ShowModal() does not work as expected then.

Would you agree?

yes and no -- ShowModal should lock up all wxFrames and wxDialogs.

But the taskbar icon is not handled by wx, and it may be very tricky to catch events from that particular source and disable them when there is a Modal Dialog up.

But it's a fine idea to post this as a Bug Report / Feature request -- maybe it's not hard to do -- I have no idea.

It should be posted to the main wxWidgets project -- this is not a wxPython-specific issue.

In the meantime, Tim's "Brute Force" approach may be what you need to do.

-CHB

 


If you actually tried my demo code, you can notice when closing the main window (clicking on the X button) puts up a 'modal' message dialog which allows doing other stuff. This, however, should *not* happen. Please tell this to Robin Dunn to look into this.

I ran my code on Windows 10 (64-bit), Python 3.6 (64-bit), wxPython Phoenix latest snapshot build.

> On 6 Mar 2017, at 08:31, Tim Roberts <[hidden email]> wrote:
>
>> On Mar 5, 2017, at 11:03 AM, Boštjan Mejak <[hidden email]> wrote:
>>
>> So, what can I do?
>
> The brute-force method would be to set a flag while your modal dialog is up, and ignore the task bar action when that flag is set.
>
> I am little confused as to why you are seeing the task bar click while a modal dialog is up, but maybe that window is considered to be owned by someone else.  If so, that would be a Windows usage issue.
> —
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[hidden email]

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Tim Roberts
Boštjan Mejak wrote:
>
> I've posted a bug report on wxWidgets' Trac site and I hope someone
> will take it seriously and fix this thing.

I do want to re-inject a note of reality here.  It seems quite possible
(I haven't checked) that you would see the exact same behavior from a
C++ Windows application going straight to the API.  If the underlying
operating system UI framework doesn't protect against this, then the
right answer would be "don't do that", in which case the wxWidgets
developers might reasonably decide this is not a bug, and categorize it
as a feature request.  You need to be prepared for this to be rated as a
low-priority item.  It's an uncommon circumstance, and the cost is
extremely low, since the application is being closed anyway.

I only point this out because you have a certain reputation for
over-reacting when things don't go your way.  I want you to be prepared.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

Boštjan Mejak-4
Please tell me in a coding language what exactly should I do. Edit my demo.py file and post it back here. If that is your desure, of course. ;)

> On 7 Mar 2017, at 19:40, Tim Roberts <[hidden email]> wrote:
>
> Boštjan Mejak wrote:
>>
>> I've posted a bug report on wxWidgets' Trac site and I hope someone
>> will take it seriously and fix this thing.
>
> I do want to re-inject a note of reality here.  It seems quite possible
> (I haven't checked) that you would see the exact same behavior from a
> C++ Windows application going straight to the API.  If the underlying
> operating system UI framework doesn't protect against this, then the
> right answer would be "don't do that", in which case the wxWidgets
> developers might reasonably decide this is not a bug, and categorize it
> as a feature request.  You need to be prepared for this to be rated as a
> low-priority item.  It's an uncommon circumstance, and the cost is
> extremely low, since the application is being closed anyway.
>
> I only point this out because you have a certain reputation for
> over-reacting when things don't go your way.  I want you to be prepared.
>
> --
> Tim Roberts, [hidden email]
> Providenza & Boekelheide, Inc.
>
> --
> 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 [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Crashed wxPython Phoenix, lightsabers up!

GadgetSteve


On 07/03/2017 19:14, Boštjan Mejak wrote:
> Please tell me in a coding language what exactly should I do. Edit my demo.py file and post it back here. If that is your desure, of course. ;)
>

Boštjan,

An untested sample of a possible work around in your demo file is
attached. The new/changed lines are all marked SJB.

--
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect
those of my employer.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

demo.py (11K) Download Attachment
12
Loading...