]> granicus.if.org Git - python/commitdiff
Adapted to new event handling. It is now also possible to abort out of
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 20 Jun 1997 16:19:14 +0000 (16:19 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 20 Jun 1997 16:19:14 +0000 (16:19 +0000)
an AESend with command-. (unless specifically disabled, of course).

Mac/Modules/ae/AEmodule.c
Mac/Modules/ae/aesupport.py

index e12c6c87abc245233ba4eacf56473ace60721196..dd4a197ffc03520a5d5d21546e295f49692fa9d4 100644 (file)
@@ -72,7 +72,12 @@ AEEventHandlerUPP upp_GenericEventHandler;
 
 static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn)
 {
-       PyMac_Yield();
+       if ( PyOS_InterruptOccurred() )
+               return 1;
+       if ( PyMac_HandleEvent(theEvent) < 0 ) {
+               fprintf(stderr, "Exception in user event handler during AE processing\n");
+               PyErr_Clear();
+       }
        return 0;
 }
 
index 8e4c7a3a44842fef94c628f3c02c954bf9503c10..707e956ad1ac5b3253749ee285e542fec9193d9e 100644 (file)
@@ -111,7 +111,12 @@ AEEventHandlerUPP upp_GenericEventHandler;
 
 static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn)
 {
-       PyMac_Yield();
+       if ( PyOS_InterruptOccurred() )
+               return 1;
+       if ( PyMac_HandleEvent(theEvent) < 0 ) {
+               fprintf(stderr, "Exception in user event handler during AE processing\\n");
+               PyErr_Clear();
+       }
        return 0;
 }