Re: Getting first responder state for a custom view enclosed in a NSTabView ?
Re: Getting first responder state for a custom view enclosed in a NSTabView ?
- Subject: Re: Getting first responder state for a custom view enclosed in a NSTabView ?
- From: Michael Clark <email@hidden>
- Date: Thu, 25 Aug 2005 00:08:16 -0400
Hi.
If you click on your view with the mouse, does it then become first
responder?
From what I remember, it will, and you should see some logs appear!
If you want this view to be the first responder by default when the
window loads you can set that up in the NIB, or do it programmatically.
Hope that helps.
Michael.
On 23-Aug-05, at 9:31 AM, Martin Wilz wrote:
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:
40marketcircle.com
This email sent to email@hidden
_______________________________________________
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