Don't destroy parents
Now that we are handling windows from inside the KiCad framing system, python console does not need to destroy its own windows. This may help prevent some odd preference corruption as well
This commit is contained in:
parent
38cdc362a0
commit
a5955ecbf7
|
@ -90,7 +90,6 @@ class KiCadPyFrame():
|
||||||
self.findData = wx.FindReplaceData()
|
self.findData = wx.FindReplaceData()
|
||||||
self.findData.SetFlags(wx.FR_DOWN)
|
self.findData.SetFlags(wx.FR_DOWN)
|
||||||
|
|
||||||
self.parent.Bind(wx.EVT_CLOSE, self.OnClose)
|
|
||||||
self.parent.Bind(wx.EVT_ICONIZE, self.OnIconize)
|
self.parent.Bind(wx.EVT_ICONIZE, self.OnIconize)
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,11 +98,6 @@ class KiCadPyFrame():
|
||||||
self.iconized = event.Iconized()
|
self.iconized = event.Iconized()
|
||||||
|
|
||||||
|
|
||||||
def OnClose(self, event):
|
|
||||||
"""Event handler for closing."""
|
|
||||||
self.parent.Destroy()
|
|
||||||
|
|
||||||
|
|
||||||
def __createMenus(self):
|
def __createMenus(self):
|
||||||
# File Menu
|
# File Menu
|
||||||
m = self.fileMenu = wx.Menu()
|
m = self.fileMenu = wx.Menu()
|
||||||
|
@ -710,7 +704,8 @@ class KiCadEditorFrame(KiCadPyFrame):
|
||||||
self._defaultText = title
|
self._defaultText = title
|
||||||
self._statusText = self._defaultText
|
self._statusText = self._defaultText
|
||||||
self.parent.SetStatusText(self._statusText)
|
self.parent.SetStatusText(self._statusText)
|
||||||
self.parent.Bind(wx.EVT_IDLE, self.OnIdle)
|
self.parent.Bind( wx.EVT_IDLE, self.OnIdle )
|
||||||
|
self.parent.Bind( wx.EVT_CLOSE, self.OnClose )
|
||||||
self._setup()
|
self._setup()
|
||||||
|
|
||||||
def _setup(self):
|
def _setup(self):
|
||||||
|
@ -733,7 +728,6 @@ class KiCadEditorFrame(KiCadPyFrame):
|
||||||
if cancel and event.CanVeto():
|
if cancel and event.CanVeto():
|
||||||
event.Veto()
|
event.Veto()
|
||||||
return
|
return
|
||||||
self.parent.Destroy()
|
|
||||||
|
|
||||||
def OnIdle(self, event):
|
def OnIdle(self, event):
|
||||||
"""Event handler for idle time."""
|
"""Event handler for idle time."""
|
||||||
|
|
Loading…
Reference in New Issue