]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/_core.py
Compilation fix. I didn't add a #error since I figured this sample will be
[wxWidgets.git] / wxPython / src / gtk / _core.py
index 366bb719945be8c210a0d0f23933269df8b4de91..6d9ccebf8795565089b1dedaf671b60f9496fa8b 100644 (file)
@@ -86,6 +86,7 @@ STATIC_BORDER = _core_.STATIC_BORDER
 TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
 NO_BORDER = _core_.NO_BORDER
 DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
+DEFAULT_STATUSBAR_STYLE = _core_.DEFAULT_STATUSBAR_STYLE
 TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
 WANTS_CHARS = _core_.WANTS_CHARS
 POPUP_WINDOW = _core_.POPUP_WINDOW
@@ -5007,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)"""
@@ -5017,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):
@@ -5690,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"""
@@ -5720,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):
@@ -8276,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):
@@ -11321,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.
 
@@ -11336,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