Re: allow user to select a directory
Re: allow user to select a directory
- Subject: Re: allow user to select a directory
- From: Ricky Sharp <email@hidden>
- Date: Mon, 7 May 2007 19:27:59 -0500
On May 7, 2007, at 7:20 PM, Nick Zitzmann wrote:
On May 7, 2007, at 6:15 PM, Roland Silver wrote:
[[NSOpenPanel openPanel] runModal] only allows the user to select
a file, not a directory.
How to allow the user to select a directory?
Like this: (disclaimer - written in Mail, untested, use at your own
risk, and all that)
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseFiles:NO];
[panel setCanChooseDirectories:YES];
[panel runModal];
Did you know about the NSOpenPanel documentation? I found that just
by looking...
There's also a sample here (also found after a quick search):
<http://cocoadev.com/index.pl?DirectoryOpenPanel>
This sample sets the flag to also allow the creation of directories
during the selection process.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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