Mercurial > cpython-lru_cache-weakref
diff Mac/Python/macglue.c @ 2276:66d6d13df4f8 legacy-trunk
Added HandleEvent method to macos, so python programs can hand back
events they don't want to handle to stdio
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Thu, 02 Feb 1995 14:25:56 +0000 |
| parents | 4bcc92916fab |
| children | 40aec48cd1e2 |
line wrap: on
line diff
--- a/Mac/Python/macglue.c Thu Feb 02 14:23:52 1995 +0000 +++ b/Mac/Python/macglue.c Thu Feb 02 14:25:56 1995 +0000 @@ -267,13 +267,34 @@ } /* +** Handle an event, either one found in the mainloop eventhandler or +** one passed back from the python program. +*/ +void +PyMac_HandleEvent(evp) + EventRecord *evp; +{ + WindowPtr wp; + +#ifdef __MWERKS__ + /* If SIOUX wants it we're done */ + (void)SIOUXHandleOneEvent(evp); +#else + /* Other compilers are just unlucky: we only weed out clicks in other applications */ + if ( evp->what == mouseDown ) { + if ( FindWindow(evp->where, &wp) == inSysWindow ) + SystemClick(evp, wp); + } +#endif /* !__MWERKS__ */ +} + +/* ** Yield the CPU to other tasks. */ static PyMac_DoYield() { EventRecord ev; - WindowPtr wp; long yield; static int no_waitnextevent = -1; int gotone; @@ -306,17 +327,7 @@ /* Get out quickly if nothing interesting is happening */ if ( !gotone || ev.what == nullEvent ) break; - -#ifdef __MWERKS__ - /* If SIOUX wants it we're done too */ - (void)SIOUXHandleOneEvent(&ev); -#else - /* Other compilers are just unlucky: we only weed out clicks in other applications */ - if ( ev.what == mouseDown ) { - if ( FindWindow(ev.where, &wp) == inSysWindow ) - SystemClick(&ev, wp); - } -#endif /* !__MWERKS__ */ + PyMac_HandleEvent(&ev); } lastyield = TickCount(); }
