• 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: Custom modal panel, like NSSavePanel/NSOpenPanel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom modal panel, like NSSavePanel/NSOpenPanel


  • Subject: Re: Custom modal panel, like NSSavePanel/NSOpenPanel
  • From: Michael Ash <email@hidden>
  • Date: Wed, 18 Mar 2009 23:12:20 -0400

On Wed, Mar 18, 2009 at 4:26 PM, Brad Peterson <email@hidden> wrote:
>
> Hi all,
>
> I would like to implement a password prompt panel class similar to NSSavePanel/NSOpenPanel, which can be shown without having to implement didEndSelectors and delegates each time.
>
> That is, I want a class that displays a password prompt, which I can show using syntax like:
>
>
>        NSString *password = [passwordPromptPanel passwordPromptModalForWindow: someWindow];
>
> in a fashion very similar to the way I'm used to using NSOpenPanel now.
>
> Is this possible? I assume it is, but I sure am stumped as to how to proceed.

Can't be done. Sheets are inherently asynchronous, which means they
need callbacks of some kind. Even NSOpenPanel/NSSavePanel can't do
what you ask: their make-a-call-and-get-an-answer methods only work
for running them modally, not running as a sheet. If you use them as
sheets, you'll use the exact same callback mechanism you say you're
trying to avoid.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >Custom modal panel, like NSSavePanel/NSOpenPanel (From: Brad Peterson <email@hidden>)

  • Prev by Date: Re: Array of Preferences
  • Next by Date: Weird NSTableView with checkboxes issue
  • Previous by thread: Custom modal panel, like NSSavePanel/NSOpenPanel
  • Next by thread: Construct type array from CGImageSourceCopyTypeIdentifiers
  • Index(es):
    • Date
    • Thread