Hello everybody,
I use wxpython 2.8.12.1 altogether with matplotlib backend (1.1.1rc) on an ubuntu machine (12.04). I
would like to connect my matplotlib canvas to a button_press_event that
pops up a wxpython message dialog (modal). When the modal dialog pops up, the whole application gets frozen BUT also the message dialog on which I do not have any control anymore AND the desktop on which the application is currently running. The only way to escape from this, is to switch desktop using keyboard and come back to the one that contains the application. This problem does not occur on a windows machine. Here is a code snippet that typically reproduces the problem.
···
##################################################
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
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 = wx.MessageDialog(self, message = "I
am Mr freeze")
d.ShowModal()
d.Destroy()
if name == “main”:
app = wx.App(False)
f = PlotterFrame(None)
f.Show()
app.MainLoop()
####################################################################
This problem does not occur with a “pure” wxpython application with no matpotlib
backend.
Am I doing something wrong or is it a bug in the matplotlib backend ?
thank you very much for your help
Eric