diff options
author | das <das> | 2002-09-12 17:34:15 (GMT) |
---|---|---|
committer | das <das> | 2002-09-12 17:34:15 (GMT) |
commit | 3511aff356300b3c67bb9cdea914d9d0680818f9 (patch) | |
tree | 5accee31b778ee9409cf319d46f1fab25dc6353b /macosx/tkMacOSXHLEvents.c | |
parent | d4c4c3a8f8edcc54b1e28e0ef3eaade3e5f2adce (diff) | |
download | tk-3511aff356300b3c67bb9cdea914d9d0680818f9.zip tk-3511aff356300b3c67bb9cdea914d9d0680818f9.tar.gz tk-3511aff356300b3c67bb9cdea914d9d0680818f9.tar.bz2 |
* generic/tk.h:
* mac/tkMacApplication.r:
* mac/tkMacLibrary.r:
* mac/tkMacResource.r:
* macosx/tkAboutDlg.r:
* macosx/tkMacOSXApplication.r:
* macosx/tkMacOSXLibrary.r:
* macosx/tkMacOSXResource.r: unified use of the two equivalent
resource compiler header inclusion defines RC_INVOKED and
RESOURCE_INCLUDED, now use RC_INVOKED throughout.
* macosx/tkMacOSXAppInit.c: improved detection of Wish startup
by the finder (by checking if stdin is /dev/null), in which
case we want to bring up the Tk console window.
* macosx/tkMacOSXHLEvents.c: added 'rapp' apple event handler.
Diffstat (limited to 'macosx/tkMacOSXHLEvents.c')
-rw-r--r-- | macosx/tkMacOSXHLEvents.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c index 4a1d30c..41b707f 100644 --- a/macosx/tkMacOSXHLEvents.c +++ b/macosx/tkMacOSXHLEvents.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.2 2002/08/31 06:12:30 das Exp $ + * RCS: @(#) $Id: tkMacOSXHLEvents.c,v 1.3 2002/09/12 17:34:16 das Exp $ */ #include "tkMacOSXUtil.h" @@ -36,6 +36,7 @@ typedef struct KillEvent { static OSErr QuitHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); static OSErr OappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); +static OSErr RappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); static OSErr OdocHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); static OSErr PrintHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); static OSErr ScriptHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon); @@ -66,7 +67,7 @@ TkMacOSXInitAppleEvents( Tcl_Interp *interp) /* Interp to handle basic events. */ { OSErr err; - AEEventHandlerUPP OappHandlerUPP, OdocHandlerUPP, + AEEventHandlerUPP OappHandlerUPP, RappHandlerUPP, OdocHandlerUPP, PrintHandlerUPP, QuitHandlerUPP, ScriptHandlerUPP, PrefsHandlerUPP; @@ -81,6 +82,10 @@ TkMacOSXInitAppleEvents( err = AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, OappHandlerUPP, (long) interp, false); + RappHandlerUPP = NewAEEventHandlerUPP(RappHandler); + err = AEInstallEventHandler(kCoreEventClass, kAEReopenApplication, + RappHandlerUPP, (long) interp, false); + OdocHandlerUPP = NewAEEventHandlerUPP(OdocHandler); err = AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, OdocHandlerUPP, (long) interp, false); @@ -165,6 +170,13 @@ OappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon) return noErr; } +static OSErr +RappHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon) +{ + ProcessSerialNumber thePSN = {0, kCurrentProcess}; + return SetFrontProcess(&thePSN); +} + /* Called when the user selects 'Preferences...' in MacOS X */ static OSErr PrefsHandler (const AppleEvent * event, AppleEvent * reply, long handlerRefcon) |