Re: NSOpenPanel and field setting
Re: NSOpenPanel and field setting
- Subject: Re: NSOpenPanel and field setting
- From: Alan Hart <email@hidden>
- Date: Tue, 18 Apr 2006 17:46:36 +0100
On 18 Apr 2006, at 16:18, Alan Smith wrote:
I have an NSOpenPanel that I want to open a folder. The question
is, in
beginSheetForDirectory... what do I set "types" to be if I want the
user to
select a folder and not a file?
I know this one :-)
NSOpenPanel *panel = [NSOpenPanel openPanel];
[panel setCanChooseDirectories: YES];
[panel setCanChooseFiles: NO];
[panel setTitle: @"Please Choose A Folder"];
[panel setPrompt: @"Choose"];
if ( [panel runModalForTypes: nil] == NSOKButton) {
folder = [[panel URLs] objectAtIndex: 0];
// ... do what you want with the folder
}
-- Alan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden