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 protected])
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 [email protected]