Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Open Handler, when is it called?



When a document is double-clicked in the Finder, the Finder (launches the target app, if not already running) and then sends an 'odoc' AppleEvent to the target application. That event is handled by our AWT and if an MRJOpenDocumentHandler is installed, it is called.

So there is no timing you can rely on for when your OpenDocumenHandler is called.

If you question is "how do I know if I will my OpenDocumentHandler will ever be called?", then you can also register an MRJOpenApplicationHandler. If the user double clicks on an application (instead of a document) in the Finder, a different AppleEvent is sent which our AWT maps to your MRJOpenApplicationHandler. Note: I believe that clicking on the dock icon for of a non-front most application with no windows will also cause an AppleEvent to be sent which maps to MRJOpenApplicationHandler.

-Nick


On Monday, May 14, 2001, at 02:21 PM, Steve Roy wrote:
When is the MRJOpenDocumentHandler called? Is that defined? What does it
depend on?

I have an application which does the following:

public class MyApp
{
public static void main(String[] args)
{
new MyApp().start();
}

public MyApp()
{
// [...]
}

public void start()
{
// [...]
}
}

When I run it on my machine, I see that the constructor and the start()
method are both called before the MRJOpenDocumentHandler get called. I need
to know if this is something I can rely on or if this is dependant on
something.


References: 
 >Open Handler, when is it called? (From: Steve Roy <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.