NSRunAlertPanel is not responding to Enter
Christiaan Hofman
cmhofman at gmail.com
Thu Jan 17 01:37:19 PST 2008
Sounds like really bad practice to override a key feature in a
generic superclass. You should do your override in a subclass. And
otherwise use [super keyDown:].
Christiaan
On 17 Jan 2008, at 5:57 AM, Chad Armstrong wrote:
> Hello:
>
> I have an NSRunAlertPanel which pops up a simple dialog box with an
> OK button. Normally, just pressing the Enter/Return button will
> tell the window to disappear.
>
> However, I've hit a snag where I'm finding this isn't working now.
> But I believe I've discovered the source of the problems. I'm
> overriding the keyDown for NSWindow so I can catch when certain
> keys are getting pressed. I'm also finding that when I'm hitting
> Enter, my keyDown method is grabbing this event. I've tried
> telling the program to send to the next registered handler, but it
> doesn't seem to change anything.
>
> Is there a way that I can set my NSRunAlertPanel so when I hit
> Enter it will go away? (If I just click on the OK button, it goes
> away with no problems.)
>
> Regards,
>
> Chad Armstrong
More information about the MacOSX-dev
mailing list