Fixed bug when closing Beremiz frame
authorLaurent Bessard
Fri, 03 May 2013 11:10:15 +0200
changeset 1090 f4d08cea7774
parent 1089 5cd1f8df71aa
child 1091 5f612651d227
Fixed bug when closing Beremiz frame
Beremiz.py
--- a/Beremiz.py	Thu May 02 14:06:24 2013 +0200
+++ b/Beremiz.py	Fri May 03 11:10:15 2013 +0200
@@ -658,8 +658,10 @@
             return IDEFrame.LoadTab(self, notebook, page_infos)
     
     def OnCloseFrame(self, event):
-        self.LogConsole.Unbind(wx.EVT_KILL_FOCUS)
-        self.LogConsole.Unbind(wx.stc.EVT_STC_UPDATEUI)
+        for evt_type in [wx.EVT_SET_FOCUS, 
+                         wx.EVT_KILL_FOCUS, 
+                         wx.stc.EVT_STC_UPDATEUI]:
+            self.LogConsole.Unbind(evt_type)
         if self.CTR is None or self.CheckSaveBeforeClosing(_("Close Application")):
             if self.CTR is not None:
                 self.CTR.KillDebugThread()