Re: NSWindow delegate handling keyboard events
Re: NSWindow delegate handling keyboard events
- Subject: Re: NSWindow delegate handling keyboard events
- From: Matt Neuburg <email@hidden>
- Date: Sat, 19 Feb 2005 09:46:04 -0800
On Fri, 18 Feb 2005 23:18:00 -0500, "Andrew O'Laughlin" <email@hidden>
said:
>Apple's event handling says that a windows delegate is part of the
>responder chain, and that the delegate doesn't need to inherit from
>NSResponder.
If it says that, then "Apple's event handling" lies.
>I'm making a simple application, and subclassing NSWindow seems like
>overkill for interpreting a few keyDown and keyUp events. How would my
>window's delegate respond to those events? Implementing
>keyDown:(NSEvent *)event in the delegate doesn't do the trick though
>the documentation seems to imply that it would.
It wouldn't. A window's delegate is not part of the chain. But the window's
controller is (this is why NSWindowController inherits from NSResponder). It
is also very easy to insert a special NSResponder object into the chain
(above the window, for example). m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden