Re: Re: NSSavePanel, NSOpenPanel... Where is NSChoosePanel?
Re: Re: NSSavePanel, NSOpenPanel... Where is NSChoosePanel?
- Subject: Re: Re: NSSavePanel, NSOpenPanel... Where is NSChoosePanel?
- From: "Bruce Johnson" <email@hidden>
- Date: Sat, 26 Aug 2006 10:10:57 -0700
Here is how I do it:
NSOpenPanel *panel = [NSOpenPanel openPanel];
NSBundle *appBundle = [NSBundle mainBundle];
NSString *appPath = [appBundle bundlePath];
[panel setCanChooseDirectories: YES];
[panel setCanChooseFiles: NO];
[panel setPrompt: @"Choose Directory"];
[panel setMessage: @"Choose Directory for Data"];
[panel beginSheetForDirectory: [appPath stringByDeletingLastPathComponent]
file: nil
types: nil
modalForWindow: [dataTextField window]
modalDelegate: self
didEndSelector: @selector(setDataDirectory: returnCode: contextInfo:)
contextInfo: NULL];
On 8/26/06, Jeremy Dronfield <email@hidden> wrote:
On 26 Aug 2006, at 1:23 pm, Trygve Inda wrote:
> I need to allow the user to choose a directory. NSSavePanel doesn't
> quite
> work since it prompts for a filename and NSOpenPanel does not allow
> the use
> of setCanCreateDirectories.
Sure it does. Remember, NSOpenPanel inherits from NSSavePanel.
Jeremy
_______________________________________________
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
--
----
Bruce Johnson
email@hidden
_______________________________________________
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