Re: Why can I make a new document this way?!
Re: Why can I make a new document this way?!
- Subject: Re: Why can I make a new document this way?!
- From: Georg Tuparev <email@hidden>
- Date: Wed, 17 Mar 2004 18:40:38 +0100
On Mar 17, 2004, at 1:21 PM, Gregory Weston wrote:
On Mar 17, 2004, at 12:43 AM, Charles Srstka wrote:
Okay, why does this script:
tell application "SuperCoolApp"
make new document
end tell
end up creating a new document object even if the application delegate
implements this method:
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender {
return NO;
}
Is this a bug in Cocoa?
It actually looks like a documentation bug. Every sample I can find
that uses this - on Apple's site and elsewhere - has a comment to the
effect that they're doing so to prevent the creation of a blank
document _on_launch_.
Well, I will not call this a bug ... just a bit confusing name :-)
To actually prevent the application of creating Untitled documents when
using the AS above or by choosing File->New Document menu one need to
override the NSDocumentController's newDocument: ... it is another
question if this is an appropriate thing to do in terms of usability
...
Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196
_______________________________________________
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.