• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Getting first responder state for a custom view enclosed in a NSTabView ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Getting first responder state for a custom view enclosed in a NSTabView ?
      • From: Michael Clark <email@hidden>
  • Prev by Date: Re: how to Encode the unicode to UTF-8 in cocoa.
  • Next by Date: Core Data: where is the default store in a CD-Document-Based-App?
  • Previous by thread: Re: how to Encode the unicode to UTF-8 in cocoa.
  • Next by thread: Re: Getting first responder state for a custom view enclosed in a NSTabView ?
  • Index(es):
    • Date
    • Thread