• 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
Re: Programatically making a particular text field active?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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

  • Prev by Date: Re: Dockling icon
  • Next by Date: Re: Dockling icon
  • Previous by thread: Programatically making a particular text field active?
  • Next by thread: NSWorkspace race condition
  • Index(es):
    • Date
    • Thread