unresponsive dialog (buttons freeze) - matplotlib problem?

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

HideRepairDialog_TEST.py (1.97 KB)

matplotlib_dialog_problem.py (2.77 KB)

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

···

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

···

Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyplate09@gmail.com
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin

wxpython_matplot.py (8.06 KB)

···

From: shangerxin@hotmail.com
To: wxpython-users@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyplate09@gmail.com
To: wxpython-users@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

···

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

Hi Ingrid,

As the demo shown, if you want to handle the pick event, I think you should bind the pick_event which will return the clicked object.

Bind the ‘pick’ event for clicking on one of the bars

···

self.canvas.mpl_connect(‘pick_event’, self.on_pick)

By the way, did you binding the same event in multiple times?

Here are several relative informations:
http://matplotlib.org/users/event_handling.html
http://stackoverflow.com/questions/15032638/how-to-return-a-value-from-button-press-event-matplotlib

Erxin


Date: Wed, 9 Apr 2014 20:36:01 -0700
From: happyplate09@gmail.com
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I know. It does not work with either Matplotlib event. I was just using the button_press_event in my sample code instead of the pick_event because it made the sample application less complicated (no need to actually plot anything to be picked). The problem is, the dialog (and the whole application with it!) freezes with either Matplotlib event.

I did not bind the same event multiple times. I switched between the two lines mentioned in my last post when I tested the sample code (always commented one of them out).

Ingrid

···

Am Mittwoch, 9. April 2014 21:56:27 UTC-7 schrieb 尚尔鑫:


Date: Wed, 9 Apr 2014 20:36:01 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

As the demo shown, if you want to handle the pick event, I think you should bind the pick_event which will return the clicked object.

Bind the ‘pick’ event for clicking on one of the bars

self.canvas.mpl_connect(‘pick_event’, self.on_pick)

By the way, did you binding the same event in multiple times?

Here are several relative informations:
http://matplotlib.org/users/event_handling.html
http://stackoverflow.com/questions/15032638/how-to-return-a-value-from-button-press-event-matplotlib

Erxin

Maybe I should mention that I have already bound the Matplotlib pick_event without problems in my main application. If you click on a marker in the plot, you can make a label appear; if you [SHIFT]-click on it, you can make it bold; if you [COMMAND]-click on it, you can hide it, etc… It all works well - so it’s not a problem with binding the Matplotlib event per se; the problem is launching the dialog from the handler.

···

Am Mittwoch, 9. April 2014 22:12:30 UTC-7 schrieb Ingrid:

I know. It does not work with either Matplotlib event. I was just using the button_press_event in my sample code instead of the pick_event because it made the sample application less complicated (no need to actually plot anything to be picked). The problem is, the dialog (and the whole application with it!) freezes with either Matplotlib event.

I did not bind the same event multiple times. I switched between the two lines mentioned in my last post when I tested the sample code (always commented one of them out).

Ingrid

Am Mittwoch, 9. April 2014 21:56:27 UTC-7 schrieb 尚尔鑫:


Date: Wed, 9 Apr 2014 20:36:01 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

As the demo shown, if you want to handle the pick event, I think you should bind the pick_event which will return the clicked object.

Bind the ‘pick’ event for clicking on one of the bars

self.canvas.mpl_connect(‘pick_event’, self.on_pick)

By the way, did you binding the same event in multiple times?

Here are several relative informations:
http://matplotlib.org/users/event_handling.html
http://stackoverflow.com/questions/15032638/how-to-return-a-value-from-button-press-event-matplotlib

Erxin

Oh, I miss understand your replay. Wish you could fix your problem in the event handler. Suggest you just write an isolate simple script to pop up the dialog and then check the result.

Erxin

···

Date: Wed, 9 Apr 2014 22:16:57 -0700
From: happyplate09@gmail.com
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Maybe I should mention that I have already bound the Matplotlib pick_event without problems in my main application. If you click on a marker in the plot, you can make a label appear; if you [SHIFT]-click on it, you can make it bold; if you [COMMAND]-click on it, you can hide it, etc… It all works well - so it’s not a problem with binding the Matplotlib event per se; the problem is launching the dialog from the handler.

Am Mittwoch, 9. April 2014 22:12:30 UTC-7 schrieb Ingrid:

I know. It does not work with either Matplotlib event. I was just using the button_press_event in my sample code instead of the pick_event because it made the sample application less complicated (no need to actually plot anything to be picked). The problem is, the dialog (and the whole application with it!) freezes with either Matplotlib event.

I did not bind the same event multiple times. I switched between the two lines mentioned in my last post when I tested the sample code (always commented one of them out).

Ingrid

Am Mittwoch, 9. April 2014 21:56:27 UTC-7 schrieb 尚尔鑫:


Date: Wed, 9 Apr 2014 20:36:01 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

As the demo shown, if you want to handle the pick event, I think you should bind the pick_event which will return the clicked object.

Bind the ‘pick’ event for clicking on one of the bars

self.canvas.mpl_connect(‘pick_event’, self.on_pick)

By the way, did you binding the same event in multiple times?

Here are several relative informations:
http://matplotlib.org/users/event_handling.html
http://stackoverflow.com/questions/15032638/how-to-return-a-value-from-button-press-event-matplotlib

Erxin

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I attached two sample programs in my first post. The “HideRepairDialog_TEST.py” shows that the dialog by itself is fine; it’s just the launching from the Matplotlib event that seems to be causing the problem. The “matplotlib_dialog_problem.py” script demonstrates this problem.

Ingrid

···

Am Mittwoch, 9. April 2014 22:23:45 UTC-7 schrieb 尚尔鑫:

Oh, I miss understand your replay. Wish you could fix your problem in the event handler. Suggest you just write an isolate simple script to pop up the dialog and then check the result.

Erxin


Date: Wed, 9 Apr 2014 22:16:57 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Maybe I should mention that I have already bound the Matplotlib pick_event without problems in my main application. If you click on a marker in the plot, you can make a label appear; if you [SHIFT]-click on it, you can make it bold; if you [COMMAND]-click on it, you can hide it, etc… It all works well - so it’s not a problem with binding the Matplotlib event per se; the problem is launching the dialog from the handler.

Am Mittwoch, 9. April 2014 22:12:30 UTC-7 schrieb Ingrid:

I know. It does not work with either Matplotlib event. I was just using the button_press_event in my sample code instead of the pick_event because it made the sample application less complicated (no need to actually plot anything to be picked). The problem is, the dialog (and the whole application with it!) freezes with either Matplotlib event.

I did not bind the same event multiple times. I switched between the two lines mentioned in my last post when I tested the sample code (always commented one of them out).

Ingrid

Am Mittwoch, 9. April 2014 21:56:27 UTC-7 schrieb 尚尔鑫:


Date: Wed, 9 Apr 2014 20:36:01 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi Erxin,
thanks a lot for your message. It helped me narrow down the problem further. Everything is indeed fine when I bind the handler with self.canvas.Bind:
self.canvas.Bind(wx.EVT_LEFT_UP, self.on_click)
However, when I bind it using matplotlib_connect, that’s when things go wrong:
self.canvas.mpl_connect(“button_press_event”, self.on_click)
Unfortunately, I cannot simply substitute self.canvas.Bind for the mpl_connect method, since I ultimately want to be able to use Matplotlib’s “pick_event” to find out which element of the plot was clicked on. That’s not so easy to find out via the Bind method. The Matplotlib event, on the other hand, has that information readily available.

Ingrid

Am Mittwoch, 9. April 2014 20:21:57 UTC-7 schrieb 尚尔鑫:

Hi Ingrid,

Sorry to give you the wrong link which is link to a matplotlib tutorial, here is the demo code to mix with wxpython and matplotlib and the author is Eli Bendersky.

Erxin


From: shang...@hotmail.com
To: wxpytho...@googlegroups.com
Subject: RE: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?
Date: Thu, 10 Apr 2014 10:56:51 +0800


Date: Wed, 9 Apr 2014 19:35:46 -0700
From: happyp...@gmail.com
To: wxpytho...@googlegroups.com
Subject: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Hi everybody,

I am still stuck on this problem. I cannot seem to launch any customizable dialogs from my Matplotlib plot - every dialog type I have tried so far freezes up in the same way. The only things that have worked so far were wx.MessageBox and wx.MessageDialog - the latter was perfectly fine with “YES”, “NO” and “Cancel” buttons, but I want to re-label the “yes” and “no” buttons to something else, and there does not seem to be any way to do that. (At least, I haven’t been able to find any.)

What can I do to solve this problem? I would greatly appreciate any workaround ideas or input on this.

Thanks,

Ingrid

Am Samstag, 29. März 2014 12:22:20 UTC-7 schrieb Ingrid:

Hi,

I have a small custom dialog (see attached sample code) that works just fine by itself. However, when I display it from within my application, it just freezes up - I can’t click any of the buttons, nor can I close the window by clicking on the close button in the upper left-hand corner of the title bar. In fact, the only way I can close the program is to either close the terminal that launched it, or kill it via Force Quit! (Also, when I try to move the dialog, it does this really weird thing of (seemingly?) multiplying itself - see screenshot below.)

I found this old thread in the archives, and yes, my application involves matplotlib as well. But I am not sure what the implications are for my problem. Robin said that “I dealt with that simply by having my wx.App and main frame classes in a module that does not import any matplotlib modules”, but in my case, I do need matplotlib for my main frame already, so this does not seem like it is an option.

Can anybody help?

Many thanks,

Ingrid

STATS:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
    SAMPLE CODE:
  • works: HideRepairDialog_TEST.py
  • doesn’t work: matplotlib_dialog_problem.py

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

you could check this link which is a demo about how to use wx mixed with matplotlib, http://www.loria.fr/~rougier/teaching/matplotlib/
I have use this code create a plc monitor application, with several modification currently it support right click on the canvas and pop up a content menu.
Wish this helpful to use.

Here is some code snippets of my application

init canvas for the frame

self.fig = Figure((5.0, 4.0), dpi = self.dpi, tight_layout=True)
self.canvas = cvs= FigCanvas(pn1, -1, self.fig)
axes = self.axes = self.fig.add_subplot(111)
self.canvas_toolbar = NavigationToolbar(self.canvas)

binding the event handler

self.canvas.Bind(wx.EVT_RIGHT_UP, self.OnCanvasRightClick)

then you could do whatever you want to handle the mouse right click event.

If you still have the problem with your custom dialog, you should check the code logic of the dialog. May be there is something wrong.

Wish this helpful to you.

Erxin.

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi Ingrid,

As the demo shown, if you want to handle the pick event, I think you should bind the pick_event which will return the clicked object.

Bind the ‘pick’ event for clicking on one of the bars

self.canvas.mpl_connect(‘pick_event’, self.on_pick)

By the way, did you binding the same event in multiple times?

Here are several relative informations:
http://matplotlib.org/users/event_handling.html
http://stackoverflow.com/questions/15032638/how-to-return-a-value-from-button-press-event-matplotlib

Erxin

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hi,

···

On 4/10/2014 8:35, Ingrid wrote:

I attached two sample programs in my first post. The "HideRepairDialog_TEST.py" shows that the dialog by itself is fine; it's just the launching from the Matplotlib event that seems to be causing the problem. The "matplotlib_dialog_problem.py" script demonstrates this problem.

I don't see the attachement in your first post, can you attach the matplotlib_dialog_problem.py again.

BTW, what version of wxPython and matplotlib are you using for this?

Werner

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
  • Matplotlib 1.3.x
···

Am Donnerstag, 10. April 2014 00:19:59 UTC-7 schrieb werner:

Hi,

On 4/10/2014 8:35, Ingrid wrote:

I attached two sample programs in my first post. The
“HideRepairDialog_TEST.py” shows that the dialog by itself is fine;
it’s just the launching from the Matplotlib event that seems to be
causing the problem. The “matplotlib_dialog_problem.py” script
demonstrates this problem.

I don’t see the attachement in your first post, can you attach the
matplotlib_dialog_problem.py again.

BTW, what version of wxPython and matplotlib are you using for this?

Werner

Sorry no Mac here, do you see the problem on Windows too?
Still no matplotlib_dialog_problem.py attached.
Werner

···

Hi,

  On 4/10/2014 9:24, Ingrid wrote:
  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
  • Matplotlib 1.3.x

Sorry, missed the first part. Here is “matplotlib_dialog_problem.py” again!

Thanks,
Ingrid

matplotlib_dialog_problem.py (2.77 KB)

···

Am Donnerstag, 10. April 2014 00:24:45 UTC-7 schrieb Ingrid:

  • Mac OS X 10.8.5
  • Python 2.7.6
  • wxPython 2.9.5.0
  • Matplotlib 1.3.x

Am Donnerstag, 10. April 2014 00:19:59 UTC-7 schrieb werner:

Hi,

On 4/10/2014 8:35, Ingrid wrote:

I attached two sample programs in my first post. The
“HideRepairDialog_TEST.py” shows that the dialog by itself is fine;
it’s just the launching from the Matplotlib event that seems to be
causing the problem. The “matplotlib_dialog_problem.py” script
demonstrates this problem.

I don’t see the attachement in your first post, can you attach the
matplotlib_dialog_problem.py again.

BTW, what version of wxPython and matplotlib are you using for this?

Werner

Hi,

···

On 4/10/2014 9:30, Ingrid wrote:

Sorry, missed the first part. Here is "matplotlib_dialog_problem.py" again!

On Windows with the following it works:

wxPython 2.9.5.0
mpl 1.3.1

So it looks like it is a Mac issue.

Werner

Interesting! It does look like it could be a Mac issue. I just tested it on two other computers:

WORKS:

  • Windows XP

  • Python 2.7.4

  • wxPython 2.8.12.1

  • matplotlib 1.2.1
    FAILS:

  • Mac OS X 10.5.8

  • Python 2.7.6

  • wxPython 2.8.12.1

  • matplotlib 1.3.1
    Hmmmm…

···

Am Donnerstag, 10. April 2014 00:36:39 UTC-7 schrieb werner:

Hi,

On 4/10/2014 9:30, Ingrid wrote:

Sorry, missed the first part. Here is “matplotlib_dialog_problem.py”
again!

On Windows with the following it works:

wxPython 2.9.5.0

mpl 1.3.1

So it looks like it is a Mac issue.

Werner

It also works on

Window 8.1

Python 2.7.6

wxPython u2.8.12.1

matplotlib 1.3.1

there is a wxpython verion for mac which is called wxmac. you coud check this question post on statckoverflow

I haven’t play with wxmac before, but wish this helpful to you.

Erxin

···

Date: Thu, 10 Apr 2014 00:56:03 -0700
From: happyplate09@gmail.com
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Re: unresponsive dialog (buttons freeze) - matplotlib problem?

Interesting! It does look like it could be a Mac issue. I just tested it on two other computers:

WORKS:

  • Windows XP
  • Python 2.7.4
  • wxPython 2.8.12.1
  • matplotlib 1.2.1
    FAILS:
  • Mac OS X 10.5.8
  • Python 2.7.6
  • wxPython 2.8.12.1
  • matplotlib 1.3.1
    Hmmmm…

Am Donnerstag, 10. April 2014 00:36:39 UTC-7 schrieb werner:

Hi,

On 4/10/2014 9:30, Ingrid wrote:

Sorry, missed the first part. Here is “matplotlib_dialog_problem.py”
again!

On Windows with the following it works:

wxPython 2.9.5.0

mpl 1.3.1

So it looks like it is a Mac issue.

Werner

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sorry to top post, but:

Try launching the dialog with wx.CallAfter(). Kind of a kludge, but if the event loop is getting tangled up, it just may work.

-Chris

···

On Apr 10, 2014, at 12:56 AM, Ingrid happyplate09@gmail.com wrote:

Interesting! It does look like it could be a Mac issue. I just tested it on two other computers:

WORKS:

  • Windows XP
  • Python 2.7.4
  • wxPython 2.8.12.1
  • matplotlib 1.2.1
    FAILS:
  • Mac OS X 10.5.8
  • Python 2.7.6
  • wxPython 2.8.12.1
  • matplotlib 1.3.1
    Hmmmm…

Am Donnerstag, 10. April 2014 00:36:39 UTC-7 schrieb werner:

Hi,

On 4/10/2014 9:30, Ingrid wrote:

Sorry, missed the first part. Here is “matplotlib_dialog_problem.py”
again!

On Windows with the following it works:

wxPython 2.9.5.0

mpl 1.3.1

So it looks like it is a Mac issue.

Werner

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 wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Thanks for your suggestion, Chris! Unfortunately, I tried it - didn’t work. :frowning:

···

Am Donnerstag, 10. April 2014 08:04:16 UTC-7 schrieb Chris Barker - NOAA Federal:

Sorry to top post, but:

Try launching the dialog with wx.CallAfter(). Kind of a kludge, but if the event loop is getting tangled up, it just may work.

-Chris

On Apr 10, 2014, at 12:56 AM, Ingrid happyp...@gmail.com wrote:

Interesting! It does look like it could be a Mac issue. I just tested it on two other computers:

WORKS:

  • Windows XP
  • Python 2.7.4
  • wxPython 2.8.12.1
  • matplotlib 1.2.1
    FAILS:
  • Mac OS X 10.5.8
  • Python 2.7.6
  • wxPython 2.8.12.1
  • matplotlib 1.3.1
    Hmmmm…

Am Donnerstag, 10. April 2014 00:36:39 UTC-7 schrieb werner:

Hi,

On 4/10/2014 9:30, Ingrid wrote:

Sorry, missed the first part. Here is “matplotlib_dialog_problem.py”
again!

On Windows with the following it works:

wxPython 2.9.5.0

mpl 1.3.1

So it looks like it is a Mac issue.

Werner

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 wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

I think I may be getting an idea of what might be happening.
One thing I noticed is that the whole thing does not freeze up if and only if you immediately hit [ENTER] when the dialog appears - no trying to click on other buttons, other parts of the dialog, or the matplotlib panel. This works because the “Cancel” button is set as the default button and therefore has the focus when the dialog is displayed. The dialog is then closed (as it should be); what remains is the matplotlib frame, which can be closed by clicking on the red “x”/close icon in its title bar. And it does close just fine, you’re back to where you started, no computer freeze-ups.

Now, on the other hand, if you click anywhere else (e.g. you try to click on one of the other buttons) after the dialog is launched, the dialog stays on top and does nothing. If you then frantically hit [ENTER] a couple of times, eventually the dialog will disappear, but now what happens is that when you try to close the main matplotlib frame, clicking on the close icon in the title bar again launches the dialog, and you’re stuck forever until you terminate the whole thing via Force Quit (or close the launching terminal).

The other thing I noticed is that when I start clicking on the other buttons (and nothing seemingly happens), the shadow that is displayed around a dialog window on a Mac becomes progressively darker with every click. Also, if you try to drag it around, you get multiple copies of the dialog displayed. So now my hypothesis is this: I think that when I try to click on the buttons in the dialog, the click is NOT caught by the event handlers in the dialog but somehow “goes through” to the matplotlib frame, which launches another dialog in response to the click, on top of the one that is currently open. So you get all these unresponsive dialogs sitting on top of your program. (Why that would ultimately affect the ability to close the main frame, after all the dialogs have been closed, I don’t really understand - but that would be part 2 of the problem). My question is now, if this is indeed what is happening, how can I make sure I catch that click on the dialog buttons and make sure it is handled by the button handlers, instead of it going to the matplotlib handler?

Hope this was clear enough, and I sure would appreciate each and every advice you guys could give me on this! Thanks for all your help so far!

Ingrid