X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce7284bd976f469991149a4ff0cd52294b9b61ad..9ec83f8da72081593c79326b30a14e40003c1945:/wxPython/src/mac/core.py diff --git a/wxPython/src/mac/core.py b/wxPython/src/mac/core.py index 2b0e5149e6..bc4641def5 100644 --- a/wxPython/src/mac/core.py +++ b/wxPython/src/mac/core.py @@ -4958,6 +4958,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): """ @@ -4982,11 +4989,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 #---------------------------------------------------------------------- @@ -5060,7 +5062,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') @@ -8131,6 +8133,8 @@ class SizerItem(Object): """GetProportion() -> int""" return _core.SizerItem_GetProportion(*args, **kwargs) + SetOption = SetProportion + GetOption = GetProportion def SetFlag(*args, **kwargs): """SetFlag(int flag)""" return _core.SizerItem_SetFlag(*args, **kwargs) @@ -9222,6 +9226,8 @@ try: except NameError: __builtins__.True = 1==1 __builtins__.False = 1==0 + def bool(value): return not not value + __builtins__.bool = bool