summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/evt/evtsupport.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1998-09-17 15:28:58 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1998-09-17 15:28:58 (GMT)
commit91b5bedf1cf35911e5b7e92af0bf4626dbd90da9 (patch)
tree54a2b8ce0a4ae881bb99d7c6f04e36a0bbafe115 /Mac/Modules/evt/evtsupport.py
parent6442116029f3ecd5768c798ac6931f32c8e73abc (diff)
downloadcpython-91b5bedf1cf35911e5b7e92af0bf4626dbd90da9.zip
cpython-91b5bedf1cf35911e5b7e92af0bf4626dbd90da9.tar.gz
cpython-91b5bedf1cf35911e5b7e92af0bf4626dbd90da9.tar.bz2
Added optional mouseregion parameter to WaitNextEvent (which is now
manually generated).
Diffstat (limited to 'Mac/Modules/evt/evtsupport.py')
-rw-r--r--Mac/Modules/evt/evtsupport.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/Mac/Modules/evt/evtsupport.py b/Mac/Modules/evt/evtsupport.py
index d1cc1d1..ed06b5d 100644
--- a/Mac/Modules/evt/evtsupport.py
+++ b/Mac/Modules/evt/evtsupport.py
@@ -74,6 +74,31 @@ execfile(INPUTFILE)
for f in functions: module.add(f)
##for f in methods: object.add(f)
+WaitNextEvent_body = """
+Boolean _rv;
+EventMask eventMask;
+EventRecord theEvent;
+UInt32 sleep;
+Handle mouseregion = (Handle)0;
+
+if (!PyArg_ParseTuple(_args, "hl|O&",
+ &eventMask,
+ &sleep,
+ OptResObj_Convert, &mouseregion))
+ return NULL;
+_rv = WaitNextEvent(eventMask,
+ &theEvent,
+ sleep,
+ (RgnHandle)mouseregion);
+_res = Py_BuildValue("bO&",
+ _rv,
+ PyMac_BuildEventRecord, &theEvent);
+return _res;
+"""
+f = ManualGenerator("WaitNextEvent", WaitNextEvent_body);
+f.docstring = lambda: "(EventMask eventMask, UInt32 sleep [,RegionHandle]) -> (Boolean _rv, EventRecord theEvent)"
+module.add(f)
+
# generate output (open the output file as late as possible)
SetOutputFileName(OUTPUTFILE)
module.generate()