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?



> At 12:01 -0700 15/5/01, "Glenn L. Austin" <email@hidden> wrote:
>>
>>> Les R. Titze <email@hidden> wrote:
>>>
>>>> I had to work around this issue in my code to determine when to show a new
>>>> untitled document.
>>>
>>> After thinking about it overnight (cook slowly...), I realize that my real
>>> problem is that my application does two different things on startup. If a
>>> document was double-clicked, it should just open the document. Otherwise,
>>> it
>>> should show a login window.
>>
>> The best way to determine whether the user double-clicked on the application
>> or a document is to add both an OpenDocument and OpenApplication handler.
>> You'll always get an OpenDocument from double-clicking a document, and
>> you'll always get an OpenApplication from double-clicking the application.
>
> But can you guarantee that the OpenApplication handler *won't* be
> called if you start the application by double clicking a document, or
> at least that the OpenDocument handler will be called first? If not,
> that doesn't really help you.

You can guarantee that the OpenApplication handler *won't* be called if the
OpenDocument handler is called.

You can find documentation on the OpenApplication handler in the "MRJToolkit
Errata" document in the SDK.

--
Glenn L. Austin
Computer Wizard and Race Car Driver
<email@hidden>
<http://www.austin-home.com/glenn/>


References: 
 >Re: Open Handler, when is it called? (From: Rolf Howarth <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.