Re: How to not open a new document at app start up (init NSDocument or NSWindowController ?)
Re: How to not open a new document at app start up (init NSDocument or NSWindowController ?)
- Subject: Re: How to not open a new document at app start up (init NSDocument or NSWindowController ?)
- From: Chris Ridd <email@hidden>
- Date: Fri, 11 Oct 2002 13:06:15 +0100
On 11/10/02 11:03 am, jean-michel daix <email@hidden> wrote:
>
Hi !
>
>
I've got a Document Based Application and I want the user to choose in a
>
preferences panel if a new document should open automatically when launching
>
application. My preferences panel works but I don't know how to cancel the
>
opening of my document windows.
>
>
I try to find a topic in the mailing list but I found nothing so here are my
>
questions :
>
>
1) Does somebody know where to find a documentation or a sample code about
>
that ?
>
>
2) If not, How to do that ? Should I modify my Document class or Window
>
Controller class to cancel the opening ?
Create an object (I called my class AppController and subclassed NSObject)
and implement this method:
- (BOOL)applicationShouldOpenUntitledFile: (NSApplication *)sender
{
return NO;
}
Instantiate it in your main nib, and make it the delegate of "File's Owner",
ie the application.
This method is described in the NSApplication documentation.
Cheers,
Chris
_______________________________________________
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.