X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61d07ac77ac5ad7b91812b93b1870d361021314d..d43e302b68ee04a8b7773f0baf5f1989fb334ec4:/wxPython/src/gtk/_core.py diff --git a/wxPython/src/gtk/_core.py b/wxPython/src/gtk/_core.py index 2120e6cb58..ceb9755a86 100644 --- a/wxPython/src/gtk/_core.py +++ b/wxPython/src/gtk/_core.py @@ -85,6 +85,8 @@ SIMPLE_BORDER = _core_.SIMPLE_BORDER 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 @@ -2033,6 +2035,9 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs): """MemoryFSHandler_RemoveFile(String filename)""" return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) +IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT +IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD +IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE #--------------------------------------------------------------------------- class ImageHandler(Object): @@ -2241,6 +2246,15 @@ class Image(Object): """ return _core_.Image_InitAlpha(*args, **kwargs) + def IsTransparent(*args, **kwargs): + """ + IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool + + Returns True if this pixel is masked or has an alpha value less than + the spcified threshold. + """ + return _core_.Image_IsTransparent(*args, **kwargs) + def FindFirstUnusedColour(*args, **kwargs): """ FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) @@ -2253,7 +2267,7 @@ class Image(Object): def ConvertAlphaToMask(*args, **kwargs): """ - ConvertAlphaToMask(self, byte threshold=128) -> bool + ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool If the image has alpha channel, this method converts it to mask. All pixels with alpha value less than ``threshold`` are replaced with mask colour and the @@ -4994,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)""" @@ -5004,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): @@ -5680,9 +5694,12 @@ your Mac.""" def __del__(self): try: self.RestoreStdio() # Just in case the MainLoop was overridden - except: - pass + finally: + wx.PyApp.__del__(self) + def Destroy(self): + wx.PyApp.Destroy(self) + self.thisown = 0 def SetTopWindow(self, frame): """Set the \"main\" top level window""" @@ -8263,6 +8280,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): @@ -11308,11 +11337,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. @@ -11323,7 +11356,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