Getting first responder state for a custom view enclosed in a NSTabView ?
Getting first responder state for a custom view enclosed in a NSTabView ?
- Subject: Getting first responder state for a custom view enclosed in a NSTabView ?
- From: Martin Wilz <email@hidden>
- Date: Tue, 23 Aug 2005 15:31:50 +0200
Hi,
I'm having trouble getting first responder status in a custom subclass
of NSView. I'd like to catch key events via -keyDown:. Some googling
showed, that the view have to aquire first responder status. As I
didn't find any other information on that topic, I assume, that's all
what it takes. But I'm happy to learn otherwise...
I overrode the following methods, but neither of them gets called at any time:
- (BOOL)becomeFirstResponder
{
NSLog (@"first responder");
return YES;
}
- (BOOL)acceptsFirstResponder
{
NSLog (@"accepting first responder");
return YES;
}
- (BOOL)resignFirstResponder
{
NSLog (@"first responder no more");
return YES;
}
My current assumption is, this behaviour might have to do with the
NSTabView, where my custom view is added at runtime. Has anyone
encountered similar problem or supects what may be the cause and how
to circumvent it ?
For further diagnosis:
I overrode NSWindows becomeKeyWindow for debugging output. It reports,
that the first responder is alway the window itself...
Thanks in advance,
Martin
_______________________________________________
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