Re: Document Model
Re: Document Model
- Subject: Re: Document Model
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 22 Oct 2002 06:41:52 -0400
on 02-10-21 10:11 PM, Chris Vincent at email@hidden wrote:
>
I'm currently developing an app with a multiple document interface.
>
However, when the app first starts up, I want to display a sort of
>
browser-type window for the user to choose what file to open. Of
>
course, many may disagree with that, but I assure you, I have my
>
reasons. The problem is, the app automagically opens up a blank
>
document. How would I go about overriding that and displaying my own
>
opening window instead?
1. To suppress the new blank untitled document, implement
applicationShouldOpenUntitledFile: in your application delegate and have it
always return NO.
This is a FAQ. Not only is it well documented, but it is asked and answered
two or three times a week on this list. You should take a minute to look at
the mailing list digest at mamasam -- it's really great for finding quick
answers to questions like this: <
http://cocoa.mamasam.com/>.
2. To open your own window at startup, you probably want to implement
applicationDidFinishLaunching: and open your browser window there. But
you'll have to figure out how to deal with the possibility that the user
launched your application by double-clicking one of its document file icons
-- that document window will be opened before you get to
applicationDidFinishLaunching:. Maybe you could use
applicationWillFinishLaunching:, instead, to avoid that issue.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.