-// #ifdef WXP_WITH_THREAD
-// PyEval_RestoreThread(wxPyEventThreadState);
-// wxPyInEvent = true;
-// #endif
-// evtobj = wxPyConstructObject((void*)&evt, "wxCommandEvent");
-// menuobj = wxPyConstructObject((void*)&menu, "wxMenu");
-// if (PyErr_Occurred()) {
-// // bail out if a problem
-// PyErr_Print();
-// goto done;
-// }
-// // Now call the callback...
-// func = ((wxPyMenu*)&menu)->func;
-// args = PyTuple_New(2);
-// PyTuple_SET_ITEM(args, 0, menuobj);
-// PyTuple_SET_ITEM(args, 1, evtobj);
-// res = PyEval_CallObject(func, args);
-// Py_DECREF(args);
-// Py_XDECREF(res); /* In case res is a NULL pointer */
-// done:
-// #ifdef WXP_WITH_THREAD
-// PyEval_SaveThread();
-// wxPyInEvent = false;
-// #endif
-// return;
-// }
+bool wxPyCallbackHelper::findCallback(const wxString& name) {
+ m_lastFound = NULL;
+ if (m_self && PyObject_HasAttrString(m_self, (char*)name.c_str()))
+ m_lastFound = PyObject_GetAttrString(m_self, (char*)name.c_str());
+
+ return m_lastFound != NULL;
+}
+
+
+int wxPyCallbackHelper::callCallback(PyObject* argTuple) {
+ PyObject* result;
+ int retval = FALSE;