NSOpenPanel shouldShowFilename delegate, or how to display a list of applications
NSOpenPanel shouldShowFilename delegate, or how to display a list of applications
- Subject: NSOpenPanel shouldShowFilename delegate, or how to display a list of applications
- From: Glen Low <email@hidden>
- Date: Wed, 7 Jul 2004 22:35:01 +0800
Dear All,
This throws up a open panel that selects only applications:
[openPanel
runModalForDirectory: nil
file: nil
types: [NSArray arrayWithObjects: @"app", NSFileTypeForHFSTypeCode
('APPL'), nil]]
Nice and dandy. But I want to limit these to those apps that can open a
certain type of file, so presumably I set the open panel's delegate and
handle the panel:shouldShowFilename: message.
Unfortunately I'm a little stuck...
1. The delegate gets this message for all files and directories.
2. How do I tell whether a particular filename is a regular directory
or .app bundle?
3. If I can figure out #2, then I suppose I could use LSCanURLAcceptURL
to determine whether the app accepts the file. I can make the required
CFURLRefs using CFURLCreateWithFileSystemPath, but this function wants
me to tell it whether the file path is really a directory?
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.