Re: How to create a modal dialog that blocks on start-up?
Re: How to create a modal dialog that blocks on start-up?
- Subject: Re: How to create a modal dialog that blocks on start-up?
- From: Eric Gorr <email@hidden>
- Date: Fri, 6 Mar 2009 08:49:57 -0500
On Mar 6, 2009, at 12:01 AM, Graham Cox wrote:
On 06/03/2009, at 3:50 PM, Graham Cox wrote:
Implement -applicationShouldOpenUntitledFile: in your app delegate
to
return a flag variable. Make sure that flag starts out as NO until
your EULA is dismissed.
--Kyle Sluder
OK. Then after closing the dialog the app doesn't open an untitled
window.
Actually the problem is more complicated than this.
The app might have been launched with a file or files, or just by
double-clicking. So if the EULA needs to be displayed this should
just defer opening the required documents. By stopping the untitled
or other files from opening, they never do.
The apple events that supply the launch files or otherwise need to
be captured (for later resending) or deferred, a the moment they are
either discarded or processed, neither of which is appropriate.
This is WAY too hard. NSApplication should either provide a delegate
hook for the purpose of displaying a modal window at startup or else
detect that a modal window was put up during launch and defer the
launch events until later.
I need a workaround, and fast - I've got to get this in before the
end of the weekend.
I believe there is a technique where by your write a separate
application which does nothing but show your dialog and then launches
your real application. Of course, you would have to find a way to
forward document open AppleEvents and perhaps other things, but it
should work.
Unfortunately, I don't have the link to this kind of technique in
front of me at the moment...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden