• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSSavepanel to init and allow <ok>
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Using NSSavepanel to init and allow <ok> (From: Ken Hawkins <email@hidden>)

  • Prev by Date: stopTracking in NSButtonCell
  • Next by Date: Re: To use ABPerson or not?
  • Previous by thread: Using NSSavepanel to init and allow <ok>
  • Next by thread: applicationDidFinishLaunching not called, how can i set the head of the fish?
  • Index(es):
    • Date
    • Thread