• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to filter the NSOpenPanel with "Recommended Applications"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >How to filter the NSOpenPanel with "Recommended Applications" (From: appleBoy chen <email@hidden>)

  • Prev by Date: Re: behavior of -copy
  • Next by Date: Re: How to filter the NSOpenPanel with "Recommended Applications"
  • Previous by thread: How to filter the NSOpenPanel with "Recommended Applications"
  • Next by thread: Re: How to filter the NSOpenPanel with "Recommended Applications"
  • Index(es):
    • Date
    • Thread