X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4acff284f9516e2a4f0fcfa7bcfa3f497b8005cc..d42e29c26f11f0875315ec7e4de52529f9d0aa52:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 866ab98cf7..fd014225e5 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -131,6 +131,9 @@ def EVT_WINDOW_CREATE(win, func): def EVT_WINDOW_DESTROY(win, func): win.Connect(-1, -1, wxEVT_DESTROY, func) +def EVT_SET_CURSOR(win, func): + win.Connect(-1, -1, wxEVT_SET_CURSOR, func) + def EVT_IDLE(win, func): @@ -198,6 +201,9 @@ def EVT_MOUSE_EVENTS(win, func): win.Connect(-1, -1, wxEVT_LEAVE_WINDOW, func) win.Connect(-1, -1, wxEVT_ENTER_WINDOW, func) +def EVT_MOUSE_CAPTURE_CHANGED(win, func): + win.Connect(-1, -1, wxEVT_MOUSE_CAPTURE_CHANGED, func) + # EVT_COMMAND def EVT_COMMAND(win, id, cmd, func): win.Connect(id, -1, cmd, func) @@ -649,6 +655,8 @@ def wxPyTypeCast(obj, typeStr): #---------------------------------------------------------------------------- +class wxPyDeadObjectError(AttributeError): + pass class _wxPyDeadObject: """ @@ -656,15 +664,21 @@ class _wxPyDeadObject: changed to this class when the C++ object is deleted. This should help prevent crashes due to referencing a bogus C++ pointer. """ + reprStr = "wxPython wrapper for DELETED %s object! (The C++ object no longer exists.)" + attrStr = "The C++ part of the %s object has been deleted, attribute access no longer allowed." + def __repr__( self ): if not hasattr(self, "_name"): self._name = "[unknown]" - return 'wxPython wrapper for deleted %s object!!! Programming logic error' % self._name + return self.reprStr % self._name def __getattr__( self, *args ): if not hasattr(self, "_name"): self._name = "[unknown]" - raise ValueError, 'Attempt to access attribute of a deleted %s object' % self._name + raise wxPyDeadObjectError( self.attrStr % self._name ) + + def __nonzero__(self): + return 0 #---------------------------------------------------------------------- @@ -709,7 +723,7 @@ class wxPyOnDemandOutputWindow: self.frame.Close() -_defRedirect = (wxPlatform == '__WXMSW__') +_defRedirect = (wxPlatform == '__WXMSW__' or wxPlatform == '__WXMAC__') #---------------------------------------------------------------------- # The main application class. Derive from this and implement an OnInit