Re: How to trap for the delete key in NSOutlineView?
Re: How to trap for the delete key in NSOutlineView?
- Subject: Re: How to trap for the delete key in NSOutlineView?
- From: Fritz Anderson <email@hidden>
- Date: Mon, 20 Jun 2005 09:12:33 -0500
On 20 Jun 2005, at 8:12 AM, Theodore H. Smith wrote:
I'm trying to trap for the delete key in my NSOutlineView.
...
In IB, I defined an NSResponder subclass. I instantiated this
object in IB. This NSResponde subclass has an outlet which is the
outlineview whose keyboard events I want to handle. Then in the
loading code for this NSResponder, do this:
if ([MyOutline nextResponder] != self ) {
[MyOutline setNextResponder:self];
}
...
Within my NSResponder subclass I have this code:
- (void)interpretKeyEvents:(NSArray *)eventArray {
[super interpretKeyEvents:eventArray]; //set a breakpoint here
}
This doesn't work.
You're assuming that NSOutlineView, before or after it does its
processing in interpretKeyEvents:, passes events up the responder
chain for additional processing. The documentation does not lead me
to believe this is so.
What prevents you from subclassing NSOutlineView, overriding keyDown:
so it responds to <delete>, and passes everything else to super?
-- F
_______________________________________________
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