Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programatically making a particular text field active?



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


References: 
 >Programatically making a particular text field active? (From: Dan Wood <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.