Re: NSSavePanel panel:shouldShowFilename:
Re: NSSavePanel panel:shouldShowFilename:
- Subject: Re: NSSavePanel panel:shouldShowFilename:
- From: Quincey Morris <email@hidden>
- Date: Mon, 15 Nov 2010 16:21:37 -0800
On Nov 15, 2010, at 15:41, Stephen Blinkhorn wrote:
> Returning NO for NSSavePanel's panel:shouldShowFilename: delegate will grey out/de-activate an item in the file browser but the item can still be selected and doing so copies the file name string into the Save As: text field.
>
> Is this the expected behaviour? I'd expect that returning NO would prevent the user from selecting that item in any way. Which it does for folders at least.
Graham and Kyle already answered the technical question but, FWIW, I believe there's some marginally interesting history here.
It's possible that this delegate method did cause files to be hidden once upon a time (pre Mac OS System 7, at least), but at some point it was decided to show the files that were actually there, disabled, instead.
It used to be true (until System 7, 8 or 9, I can't remember which) that clicking on disabled items had no effect. However, a number of system extensions (like Default Folder, but I think that wasn't the first) added the ability to option-click on a disabled item to prefill the text field with an existing name, typically so that you could change it slightly rather than retyping the whole thing. At some point (possibly Mac OS X 10.0), Apple quietly adopted this very useful convention.
Note that this method is deprecated in 10.6, and its replacement is called 'panel:shouldEnableURL:' rather than 'panel:shouldShowURL:', but the useful click-to-prefill behavior survives.
_______________________________________________
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