Re: not having a new document be created on launch
Re: not having a new document be created on launch
- Subject: Re: not having a new document be created on launch
- From: Kolja Wawrowsky <email@hidden>
- Date: Mon, 27 May 2002 16:52:45 -0700
You need to overwrite the applicationShouldOpenUntitledFile method in
NSDocumentController.
and here the long version:
- in Interface builder:
1.) create a NSDocumentController subclass in the mainmenu.nib file
2.) generate the .h and .m files for the class
3.) instantiate the subclass
4.) make the instance a delegate of "File's owner" ( = NSApplication)
-in project builder
5.) declare the following method in the generated . h file
- (BOOL) applicationShouldOpenUntitledFile:(NSApplication*) sender ;
6.) implement the method in the generated .m file:
- (BOOL) applicationShouldOpenUntitledFile:(NSApplication*) sender
{
return NO;
}
Done!
Have fun,
Kolja
______________________
Kolja Wawrowsky
Cedars Sinai Medical Center
On Sunday, May 26, 2002, at 11:13 PM, Chaz wrote:
>
Hello:
>
>
I'm sure this topic has been discussed to death, but I can never
>
find anything in the archives. In a document-based application, a new
>
document is created when the application launches. But my application
>
is a viewer, and obviously I don't want new "blank" documents coming up
>
since there is nothing to create. How can this feature be disabled?
>
>
Thanks,
>
Chaz McGarvey
>
_______________________________________________
>
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.
_______________________________________________
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.