X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a7ea057cd6bf54d645134615f4c9d247767cef0..9176f38f730c3415ac7a911c2f85cdea7eca4478:/wxPython/src/_app_ex.py diff --git a/wxPython/src/_app_ex.py b/wxPython/src/_app_ex.py index 8efa406e2c..f3246fbcc6 100644 --- a/wxPython/src/_app_ex.py +++ b/wxPython/src/_app_ex.py @@ -29,6 +29,13 @@ class PyOnDemandOutputWindow: EVT_CLOSE(self.frame, self.OnCloseWindow) + def OnCloseWindow(self, event): + if self.frame is not None: + self.frame.Destroy() + self.frame = None + self.text = None + + # These methods provide the file-like output behaviour. def write(self, text): """ @@ -53,11 +60,6 @@ class PyOnDemandOutputWindow: wx.CallAfter(self.frame.Close) - def OnCloseWindow(self, event): - if self.frame is not None: - self.frame.Destroy() - self.frame = None - self.text = None #---------------------------------------------------------------------- @@ -131,7 +133,7 @@ your Mac.""" self.RestoreStdio() - def RedirectStdio(self, filename): + def RedirectStdio(self, filename=None): """Redirect sys.stdout and sys.stderr to a file or a popup window.""" if filename: _sys.stdout = _sys.stderr = open(filename, 'a')