Passing None to an EVT_* function will Disconnect
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c0c84fa088
commit
25b00b4e8c
@ -472,6 +472,14 @@ static void wxEvtHandler_Connect(wxEvtHandler *self,int id,int lastId,int ev
|
||||
(wxObjectEventFunction) &wxPyCallback::EventThunker,
|
||||
new wxPyCallback(func));
|
||||
}
|
||||
else if (func == Py_None) {
|
||||
self->Disconnect(id, lastId, eventType,
|
||||
(wxObjectEventFunction)
|
||||
&wxPyCallback::EventThunker);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected callable object or None.");
|
||||
}
|
||||
}
|
||||
static PyObject *_wrap_wxEvtHandler_Connect(PyObject *self, PyObject *args, PyObject *kwargs) {
|
||||
PyObject * _resultobj;
|
||||
|
@ -63,6 +63,14 @@ public:
|
||||
(wxObjectEventFunction) &wxPyCallback::EventThunker,
|
||||
new wxPyCallback(func));
|
||||
}
|
||||
else if (func == Py_None) {
|
||||
self->Disconnect(id, lastId, eventType,
|
||||
(wxObjectEventFunction)
|
||||
&wxPyCallback::EventThunker);
|
||||
}
|
||||
else {
|
||||
PyErr_SetString(PyExc_TypeError, "Expected callable object or None.");
|
||||
}
|
||||
}
|
||||
|
||||
bool Disconnect(int id, int lastId = -1,
|
||||
|
Loading…
Reference in New Issue
Block a user