• 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: NSAlert - multiple key equivalents for buttons?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAlert - multiple key equivalents for buttons?


  • Subject: Re: NSAlert - multiple key equivalents for buttons?
  • From: David Reitter <email@hidden>
  • Date: Wed, 7 Oct 2009 14:19:02 -0400

On Oct 7, 2009, at 2:09 PM, Jens Alfke wrote:

I think the best way is to create your own alert panel in a nib and run it modally. That way you have total control — you can set your own window delegate to handle key events, for example.

I had a similar solution beforehand but gave up on it because the layout was painful to control, and the sheet animation wasn't quite right. Future compatibility is an important consideration.


Of course I'm already subclassing NSAlert.

On Oct 7, 2009, at 2:04 PM, Kyle Sluder wrote:

You're probably going to need to stop using NSAlert and start using
your own window as a sheet.  Then you should be able to override
-sendEvent: to perform your custom processing.

Hmm, if I define

@interface MyNSWindow : NSWindow
@interface MyNSAlert : NSAlert

can I then perhaps, in @implementation MyNSAlert:

window = (MyNSAlert*)  [window clone];

That way I could get NSAlert to do all the layout and prepare the window, but then take over and roll my own?

- D

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSAlert - multiple key equivalents for buttons?
      • From: Kyle Sluder <email@hidden>
References: 
 >NSAlert - multiple key equivalents for buttons? (From: David Reitter <email@hidden>)
 >Re: NSAlert - multiple key equivalents for buttons? (From: Jens Alfke <email@hidden>)

  • Prev by Date: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
  • Next by Date: Re: Constructive Criticism
  • Previous by thread: Re: NSAlert - multiple key equivalents for buttons?
  • Next by thread: Re: NSAlert - multiple key equivalents for buttons?
  • Index(es):
    • Date
    • Thread