Re: How to filter the NSOpenPanel with "Recommended Applications"
Re: How to filter the NSOpenPanel with "Recommended Applications"
- Subject: Re: How to filter the NSOpenPanel with "Recommended Applications"
- From: Quincey Morris <email@hidden>
- Date: Thu, 27 May 2010 09:39:23 -0700
On May 26, 2010, at 19:55, appleBoy chen wrote:
> if([openPanel runModalForTypes:[NSArray arrayWithObjects:@"app",nil]] ==
> NSOKButton)
> {
> ...
> }
>
> And, I want to only show the supported application for the associated file.
> Like Finder's "Choose Application" Panel, it can set Eanble to "Recommended
> Applications" to filter the applications. the NSOpenPanel can support it?
Yes, use a delegate.
To enable or disable items, in 10.5 or earlier, use the 'panel:shouldShowFilename:' delegate method (documented in the superclass, NSSavePanel). In 10.6, use the 'panel:shouldEnableURL:' delegate method, documented in the NSOpenSavePanelDelegate protocol.
To determine whether an application is to be enabled or not, you'll need to to use Launch Services. There was a thread about this a couple of days ago.
_______________________________________________
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