summaryrefslogtreecommitdiffstats
path: root/Mac/Modules
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-02-02 14:25:56 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-02-02 14:25:56 (GMT)
commita76382a6ac56b35def05f23740e55dc064eb15e7 (patch)
tree422f6be5564e54f4d9e9a58a0903d7b2f66606c0 /Mac/Modules
parent8828fcf7383aa38539fd331d9b93138c156f8810 (diff)
downloadcpython-a76382a6ac56b35def05f23740e55dc064eb15e7.zip
cpython-a76382a6ac56b35def05f23740e55dc064eb15e7.tar.gz
cpython-a76382a6ac56b35def05f23740e55dc064eb15e7.tar.bz2
Added HandleEvent method to macos, so python programs can hand back
events they don't want to handle to stdio
Diffstat (limited to 'Mac/Modules')
-rw-r--r--Mac/Modules/macosmodule.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c
index 2b98fc6..ceb8a96 100644
--- a/Mac/Modules/macosmodule.c
+++ b/Mac/Modules/macosmodule.c
@@ -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 */
};