WxPython 3.x -> 4.x : removed exception on stdout when closing at IDE frame
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Mon, 13 Sep 2021 17:57:47 +0200
changeset 3350 0d86fd9691ec
parent 3349 e7bd3ee40a64
child 3351 88dbdebd10fc
WxPython 3.x -> 4.x : removed exception on stdout when closing at IDE frame
BeremizIDE.py
IDEFrame.py
--- a/BeremizIDE.py	Fri Sep 10 14:48:07 2021 +0200
+++ b/BeremizIDE.py	Mon Sep 13 17:57:47 2021 +0200
@@ -474,8 +474,6 @@
         if self.EnableDebug:
             self.DebugVariablePanel.SetDataProducer(self.CTR)
 
-        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
-
         self._Refresh(TITLE, EDITORTOOLBAR, FILEMENU, EDITMENU, DISPLAYMENU)
         self.RefreshAll()
         self.LogConsole.SetFocus()
@@ -640,6 +638,7 @@
     def OnCloseFrame(self, event):
         if self.TryCloseFrame():
             self.LogConsole.Disconnect(-1, -1, wx.wxEVT_KILL_FOCUS)
+            super(Beremiz, self).OnCloseFrame(event)
             event.Skip()
         else:
             # prevent event to continue, i.e. cancel closing
--- a/IDEFrame.py	Fri Sep 10 14:48:07 2021 +0200
+++ b/IDEFrame.py	Mon Sep 13 17:57:47 2021 +0200
@@ -759,6 +759,8 @@
         self.SetRefreshFunctions()
         self.SetDeleteFunctions()
 
+        self.Bind(wx.EVT_CLOSE, self.OnCloseFrame)
+
         wx.CallAfter(self.InitFindDialog)
 
     def __del__(self):
@@ -1154,6 +1156,9 @@
     def OnQuitMenu(self, event):
         self.Close()
 
+    def OnCloseFrame(self, event):
+        self.AUIManager.UnInit()
+
     # -------------------------------------------------------------------------------
     #                            Edit Menu Functions
     # -------------------------------------------------------------------------------