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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 尚尔鑫:
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.
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.
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.
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 尚尔鑫:
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.
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.
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.
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.
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 尚尔鑫:
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.
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.
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.
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.
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 尚尔鑫:
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.
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.
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.
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?
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?
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?
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!