Re: Using NSSavepanel to init and allow <ok>
Re: Using NSSavepanel to init and allow <ok>
- Subject: Re: Using NSSavepanel to init and allow <ok>
- From: Fritz Anderson <email@hidden>
- Date: Mon, 15 Mar 2004 21:07:57 -0600
On 15 Mar 2004, at 10:34 AM, Ken Hawkins wrote:
i have an NSSavePanel created
NSSavePanel * panel = [NSSavePanel savePanel];
[panel setCanChooseDirectories:YES];
Does it give you pause that the compiler warns here that NSSavePanel
does not implement setCanChooseDirectories: ? Because, in fact, it
doesn't, at least not in its public interface. NSSavePanels can't
choose directories, or any other kinds of files. The directory-choosing
is incidental to the main task of the panel, which is generating a new
filename.
NSOpenPanel is the object that chooses files and directories and such.
[panel setCanCreateDirectories:YES];
[panel beginSheetForDirectory:NSHomeDirectory()
file:nil
modalForWindow:sender
modalDelegate:self
didEndSelector:@selector(filePanelDidEnd:
returnCode:
contextInfo:)
contextInfo:nil];
and my only question is that when it comes up the ok button is grayed
out. how can i have the panel come up and default to the passed in
directory? in this case 'NSHomeDirectory()'?
The OK button is grayed out because an NSSavePanel isn't supposed to be
ready for the OK button until something has been typed into its text
field. That's the way Save panels work.
-- F
_______________________________________________
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.