Note that there are some explanatory texts on larger screens.

plurals
  1. POModal dialog freezes the whole application
    text
    copied!<p>I use wxpython altogether with matplotlib backend on an ubuntu machine. I would like to connect my matplotlib canvas to a button_press_event that pops up a wxpython modal dialog. When the modal dialog pops up, the whole application gets frozen. This problem does not occur on a windows machine. Here is a snippet that typically reproduces the problem.</p> <pre><code>import wx from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.figure import Figure class SettingDialog(wx.Dialog): def __init__(self, parent=None): wx.Dialog.__init__(self, parent, wx.ID_ANY, title="Modal dialog") class PlotterFrame(wx.Frame): def __init__(self, parent, title="Frame with matplotlib canvas"): wx.Frame.__init__(self, parent, wx.ID_ANY, title) self.figure = Figure(figsize=(5,4), dpi=None) self.canvas = FigureCanvasWxAgg(self, -1, self.figure ) self.canvas.mpl_connect("button_press_event", self.on_click) def on_click(self, event=None): d = SettingDialog(self) d.ShowModal() d.Destroy() if __name__ == "__main__": app = wx.App(False) f = PlotterFrame(None) f.Show() app.MainLoop() </code></pre> <p>Would you have any idea of what is wrong with my code ?</p> <p>PS0 : The problem is that the dialog window is also frozen, like all the applications in the desktop wich do not react anymore. the only way to escape is to switch to another desktop using the keyboard </p> <p>PS1 : with a very common example like <a href="http://eli.thegreenplace.net/files/prog_code/wx_mpl_bars.py.txt" rel="nofollow noreferrer">http://eli.thegreenplace.net/files/prog_code/wx_mpl_bars.py.txt</a> the problem also appear, I conclude so that, this issue is a bug on linux (here ubuntu 12.04) for the following libs version : wx.<strong>version</strong> : '2.8.12.1' matplotlib.<strong>version</strong> : '1.1.1rc'</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload