Sadly I'm pretty certain there's no API to disable the button. But you can fairly easily implement the -panel:isValidFilename: delegate method and return NO to stop the user opening a folder. Calling NSBeep() at the same time wouldn't be amiss I imagine.

Mike.

On 30 Jan 2009, at 01:18, Ron Aldrich wrote:

Hello,

I'm trying to filter the contents of a standard NSOpenPanel dialog such that only certain folders can be opened.

If I implement - (BOOL) panel:(id)sender shouldShowFilename: (NSString *) fileName; such that it returns true for the folders that I want to allow, and false for others, it prevents the user from navigating their hard drive.

The problem is, that the result of panel:shouldShowFilename: controls both the the ability to navigate within a folder, and whether or not the "Open" button is enabled.

So, is there a way to control the enable state of the "Open" button for a folder, without preventing the user from navigating into that folder?

Thanks for your time,

Ron Aldrich
Software Architects, Inc.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40mikeabdullah.net

This email sent to cocoa...@mikeabdullah.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to