summaryrefslogtreecommitdiffstats
path: root/Mac/Python/macgetargv.c
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-07-29 13:50:59 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-07-29 13:50:59 (GMT)
commitcc456fbe82cf55fcec71d4237b86cea2bc1c1cef (patch)
tree174c25a153cc45ab60760b630a10a5fdf0739b9b /Mac/Python/macgetargv.c
parent7571f30efe935bfddd2be3a8e716f2dda2e55f9e (diff)
downloadcpython-cc456fbe82cf55fcec71d4237b86cea2bc1c1cef.zip
cpython-cc456fbe82cf55fcec71d4237b86cea2bc1c1cef.tar.gz
cpython-cc456fbe82cf55fcec71d4237b86cea2bc1c1cef.tar.bz2
Un-installing of AE handlers fixed (AE is very picky that you specify
the same UPP)
Diffstat (limited to 'Mac/Python/macgetargv.c')
-rw-r--r--Mac/Python/macgetargv.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/Mac/Python/macgetargv.c b/Mac/Python/macgetargv.c
index 5f2e637..2c90997 100644
--- a/Mac/Python/macgetargv.c
+++ b/Mac/Python/macgetargv.c
@@ -235,18 +235,25 @@ handle_open_doc(AppleEvent *theAppleEvent, AppleEvent *reply, long refCon)
}
/* Install standard core event handlers */
+AEEventHandlerUPP open_doc_upp;
+AEEventHandlerUPP open_app_upp;
+AEEventHandlerUPP not_upp;
static void
set_ae_handlers()
{
+ open_doc_upp = NewAEEventHandlerProc(handle_open_doc);
+ open_app_upp = NewAEEventHandlerProc(handle_open_app);
+ not_upp = NewAEEventHandlerProc(handle_not);
+
AEInstallEventHandler(kCoreEventClass, kAEOpenApplication,
- NewAEEventHandlerProc(handle_open_app), 0L, false);
+ open_app_upp, 0L, false);
AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments,
- NewAEEventHandlerProc(handle_open_doc), 0L, false);
+ open_doc_upp, 0L, false);
AEInstallEventHandler(kCoreEventClass, kAEPrintDocuments,
- NewAEEventHandlerProc(handle_not), 0L, false);
+ not_upp, 0L, false);
AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
- NewAEEventHandlerProc(handle_not), 0L, false);
+ not_upp, 0L, false);
}
/* Uninstall standard core event handlers */
@@ -255,13 +262,13 @@ static void
reset_ae_handlers()
{
AERemoveEventHandler(kCoreEventClass, kAEOpenApplication,
- NewAEEventHandlerProc(handle_open_app), false);
+ open_app_upp, false);
AERemoveEventHandler(kCoreEventClass, kAEOpenDocuments,
- NewAEEventHandlerProc(handle_open_doc), false);
+ open_doc_upp, false);
AERemoveEventHandler(kCoreEventClass, kAEPrintDocuments,
- NewAEEventHandlerProc(handle_not), false);
+ not_upp, false);
AERemoveEventHandler(kCoreEventClass, kAEQuitApplication,
- NewAEEventHandlerProc(handle_not), false);
+ not_upp, false);
}
/* Wait for events until a core event has been handled */