ubuntuマシンでmatplotlibバックエンドと一緒にwxpythonを使用しています。私のmatplotlibキャンバスをwxpythonモーダルダイアログをポップアップするbutton_press_eventに接続したいと思います。モーダル ダイアログが表示されると、アプリケーション全体がフリーズします。この問題は、Windows マシンでは発生しません。通常、問題を再現するスニペットを次に示します。
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()
私のコードの何が問題なのか分かりますか?
PS0 : 問題は、デスクトップ内のすべてのアプリケーションが反応しなくなるのと同様に、ダイアログ ウィンドウもフリーズすることです。脱出する唯一の方法は、キーボードを使用して別のデスクトップに切り替えることです
PS1 : http://eli.thegreenplace.net/files/prog_code/wx_mpl_bars.py.txt のような非常に一般的な例では、問題も発生します。結論として、この問題は Linux (ここでは ubuntu 12.04) のバグです。次のライブラリ バージョン: wx. バージョン: '2.8.12.1' matplotlib. バージョン: '1.1.1rc'