Re: Programatically making a particular text field active?
Re: Programatically making a particular text field active?
- Subject: Re: Programatically making a particular text field active?
- From: Vince DeMarco <email@hidden>
- Date: Wed, 16 May 2001 21:20:05 -0700
On Wednesday, May 16, 2001, at 04:53 PM, Dan Wood wrote:
I'm not clear on how to make a particular text field be the 'target'
(i.e., highlighted and ready for key events, probably equivalent to
being first responder). For instance, when I install a custom view
programatically, I want the first text field in that subview to be
active. The documentation isn't quite clear on what I need to do ...
maybe setNextResponder, but sent to what object?
NSWindow has a method called
- (BOOL)makeFirstResponder:(NSResponder *)aResponder;
so for a text field do this
[[textField window] makeFirstResponder:textField];
vince