X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d14a1e28567de23c586bc80017073d0c39f8d18f..49bffb1482cd2a6a30b38280f6c9bffc72dbfe42:/wxPython/src/_evthandler.i?ds=sidebyside diff --git a/wxPython/src/_evthandler.i b/wxPython/src/_evthandler.i index 1d3f53ceb9..2fed5cab97 100644 --- a/wxPython/src/_evthandler.i +++ b/wxPython/src/_evthandler.i @@ -53,7 +53,8 @@ public: &wxPyCallback::EventThunker); } else { - PyErr_SetString(PyExc_TypeError, "Expected callable object or None."); + wxPyBLOCK_THREADS( + PyErr_SetString(PyExc_TypeError, "Expected callable object or None.")); } } @@ -105,6 +106,14 @@ public: id = source.GetId() event.Bind(self, id, id2, handler) + def Unbind(self, event, source=None, id=wx.ID_ANY, id2=wx.ID_ANY): + """ + Disconencts the event handler binding for event from self. + Returns True if successful. + """ + if source is not None: + id = source.GetId() + return event.Unbind(self, id, id2) }