From 0205dfb33c3a74f7d036b0d830fdb6a4d85d9aa8 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 12 Nov 2010 22:29:50 +0100 Subject: [PATCH] Unbind when graphframe gets closed --- gui/graphFrame.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gui/graphFrame.py b/gui/graphFrame.py index 63e5bfe11..b0f565538 100644 --- a/gui/graphFrame.py +++ b/gui/graphFrame.py @@ -89,6 +89,12 @@ class GraphFrame(wx.Frame): self.fitList.fitList.Bind(wx.EVT_LEFT_DCLICK, self.removeItem) self.mainFrame.Bind(gui.fittingView.FIT_CHANGED, self.draw) + self.Bind(wx.EVT_CLOSE, self.close) + + def close(self, event): + self.fitList.fitList.Unbind(wx.EVT_LEFT_DCLICK, handler=self.removeItem) + self.mainFrame.Unbind(gui.fittingView.FIT_CHANGED, handler=self.draw) + event.Skip() def getView(self): return self.graphSelection.GetClientData(self.graphSelection.GetSelection()) @@ -185,6 +191,7 @@ class GraphFrame(wx.Frame): self.fitList.fitList.update(self.fits) self.draw() + class FitList(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent)