Added HandleEvent method to macos, so python programs can hand back

events they don't want to handle to stdio
This commit is contained in:
Jack Jansen 1995-02-02 14:25:56 +00:00
parent 8828fcf738
commit a76382a6ac
3 changed files with 39 additions and 13 deletions

View file

@ -202,6 +202,19 @@ MacOS_EnableAppswitch(PyObject *self, PyObject *args)
return Py_None;
}
static PyObject *
MacOS_HandleEvent(PyObject *self, PyObject *args)
{
EventRecord ev;
if (!PyArg_ParseTuple(args, "O&", PyMac_GetEventRecord, &ev))
return NULL;
PyMac_HandleEvent(&ev);
Py_INCREF(Py_None);
return Py_None;
}
static PyMethodDef MacOS_Methods[] = {
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1},
{"GetCreatorAndType", MacOS_GetCreatorAndType, 1},
@ -211,6 +224,7 @@ static PyMethodDef MacOS_Methods[] = {
#endif
{"SetScheduleTimes", MacOS_SetScheduleTimes, 1},
{"EnableAppswitch", MacOS_EnableAppswitch, 1},
{"HandleEvent", MacOS_HandleEvent, 1},
{NULL, NULL} /* Sentinel */
};