I have an NSPopUpButton
and even a simple subclass of NSPopUpButton
.
In the subclass I have:
- (BOOL)acceptsFirstResponder { return YES; }
- (BOOL)refusesFirstResponder { return NO; }
Now it's easy enough to tell the window to make the button first responder, and that works on launch, but I need this to also occur as nextResponder from tabbing out of an NSTextField. Once focus is on any NSTextField, it never seems to be able to move back to the popupbutton.
What am I missing here? It seems like it should be really simple.
ANSWER: firstResponder is not the thing to use here. A subclass is needed (as I suspected) and simply needs to override the following to return YES:
- (BOOL)canBecomeKeyView { return YES; }
(thanks Peter Hosey)
nextKeyView
? – Peter HoseycanBecomeKeyView
method. – Peter HoseycanBecomeKeyView {return YES;}
in my subclass did the trick. Please add as answer and I'll accept it! firstResponder was not the method I was looking for. – uchuugaka