Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3757523

Browse files
committed
Adapted to new event handling. It is now also possible to abort out of
an AESend with command-. (unless specifically disabled, of course).
1 parent 36ed506 commit 3757523

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

Mac/Modules/ae/AEmodule.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ AEEventHandlerUPP upp_GenericEventHandler;
7272

7373
static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn)
7474
{
75-
PyMac_Yield();
75+
if ( PyOS_InterruptOccurred() )
76+
return 1;
77+
if ( PyMac_HandleEvent(theEvent) < 0 ) {
78+
fprintf(stderr, "Exception in user event handler during AE processing\n");
79+
PyErr_Clear();
80+
}
7681
return 0;
7782
}
7883

Mac/Modules/ae/aesupport.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ def passInput(self, name):
111111
112112
static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn)
113113
{
114-
PyMac_Yield();
114+
if ( PyOS_InterruptOccurred() )
115+
return 1;
116+
if ( PyMac_HandleEvent(theEvent) < 0 ) {
117+
fprintf(stderr, "Exception in user event handler during AE processing\\n");
118+
PyErr_Clear();
119+
}
115120
return 0;
116121
}
117122

0 commit comments

Comments
 (0)