mlfarrell
2006.07.27, 09:08 PM
I'm trying to handle the kAEOpenDocuments message in my gtk program but I suspect X11 is intercepting the message. Is there anything I can do about this?
static OSErr open_documents_ae_handler(const AppleEvent *apple_event, AppleEvent *reply, SInt32 ref_con)
{
//never gets called on document double click
//program does get launched though if it wasn't running
app.message_box("Something happened!");
return noErr;
}
AEEventHandlerUPP od_handler = NewAEEventHandlerUPP(open_documents_ae_handler);
if(AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, od_handler, NULL, false) != noErr)
cerr << "Error installing apple event handler for open documents!" << endl;
DisposeAEEventHandlerUPP(od_handler);
static OSErr open_documents_ae_handler(const AppleEvent *apple_event, AppleEvent *reply, SInt32 ref_con)
{
//never gets called on document double click
//program does get launched though if it wasn't running
app.message_box("Something happened!");
return noErr;
}
AEEventHandlerUPP od_handler = NewAEEventHandlerUPP(open_documents_ae_handler);
if(AEInstallEventHandler(kCoreEventClass, kAEOpenDocuments, od_handler, NULL, false) != noErr)
cerr << "Error installing apple event handler for open documents!" << endl;
DisposeAEEventHandlerUPP(od_handler);