X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6d88e19211e8f17bbd16a7e7623472d3f687cafe..711f6fce1d99eec4135bebbef15c05c9f9dd398b:/wxPython/src/gtk/_core.py diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index 15b96cc1d8..6d9ccebf87 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -5008,8 +5008,8 @@ class PyApp(EvtHandler): self.this = newobj.this self.thisown = 1 del newobj.thisown - self._setCallbackInfo(self, PyApp) - self._setOORInfo(self) + self._setCallbackInfo(self, PyApp, False) + self._setOORInfo(self, False) def __del__(self, destroy=_core_.delete_PyApp): """__del__(self)""" @@ -5018,7 +5018,7 @@ class PyApp(EvtHandler): except: pass def _setCallbackInfo(*args, **kwargs): - """_setCallbackInfo(self, PyObject self, PyObject _class)""" + """_setCallbackInfo(self, PyObject self, PyObject _class, bool incref)""" return _core_.PyApp__setCallbackInfo(*args, **kwargs) def GetAppName(*args, **kwargs): @@ -5691,12 +5691,13 @@ your Mac.""" self._BootstrapApp() - def __del__(self): - try: - self.RestoreStdio() # Just in case the MainLoop was overridden - except: - pass + def __del__(self, destroy=wx.PyApp.__del__): + self.RestoreStdio() # Just in case the MainLoop was overridden + destroy(self) + def Destroy(self): + wx.PyApp.Destroy(self) + self.thisown = 0 def SetTopWindow(self, frame): """Set the \"main\" top level window""" @@ -5721,7 +5722,10 @@ your Mac.""" def RestoreStdio(self): - _sys.stdout, _sys.stderr = self.saveStdio + try: + _sys.stdout, _sys.stderr = self.saveStdio + except: + pass def SetOutputWindowAttributes(self, title=None, pos=None, size=None): @@ -8277,6 +8281,18 @@ def FindWindowByLabel(*args, **kwargs): def Window_FromHWND(*args, **kwargs): """Window_FromHWND(Window parent, unsigned long _hWnd) -> Window""" return _core_.Window_FromHWND(*args, **kwargs) + +def GetTopLevelWindows(*args, **kwargs): + """ + GetTopLevelWindows() -> PyObject + + Returns a list of the the application's top-level windows, (frames, + dialogs, etc.) NOTE: Currently this is a copy of the list maintained + by wxWidgets, and so it is only valid as long as no top-level windows + are closed or new top-level windows are created. + + """ + return _core_.GetTopLevelWindows(*args, **kwargs) #--------------------------------------------------------------------------- class Validator(EvtHandler): @@ -11322,11 +11338,15 @@ if RELEASE_VERSION != _core_.RELEASE_VERSION: #---------------------------------------------------------------------------- -# Set the default string<-->unicode conversion encoding from the -# locale. This encoding is used when string or unicode objects need -# to be converted in order to pass them to wxWidgets. Please be aware -# that the default encoding within the same locale may be slightly -# different on different platforms. For example, please see +# Set wxPython's default string<-->unicode conversion encoding from +# the locale, but only if Python's default hasn't been changed. (We +# assume that if the user has customized it already then that is the +# encoding we need to use as well.) +# +# The encoding selected here is used when string or unicode objects +# need to be converted in order to pass them to wxWidgets. Please be +# aware that the default encoding within the same locale may be +# slightly different on different platforms. For example, please see # http://www.alanwood.net/demos/charsetdiffs.html for differences # between the common latin/roman encodings. @@ -11337,7 +11357,7 @@ if default == 'ascii': try: default = locale.getdefaultlocale()[1] codecs.lookup(default) - except (ValueError, LookupError): + except (ValueError, LookupError, TypeError): default = _sys.getdefaultencoding() del locale del codecs