Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

NusuniAdmin

macrumors 6502a
Original poster
Nov 19, 2003
870
1
How would I go about getting the currently focused control? I mean there has to be some method I am missing that will return an identifier for the currently focused control.

Also is there a method or something that is called each time a control gets focused and loses the focus.


The reason I am asking is I want some specific things to happen when a control gets its focus and when it loses it.
 

iMeowbot

macrumors G3
Aug 30, 2003
8,634
0
You can call the window's firstResponder to get a pointer to the object with that status. Is that what you mean?

This article contains an example; see textObjectToSearchIn
 

NusuniAdmin

macrumors 6502a
Original poster
Nov 19, 2003
870
1
this may do what I want, thnx. I will try it out and see how it goes.
 

NusuniAdmin

macrumors 6502a
Original poster
Nov 19, 2003
870
1
hmm how come when resignFirstResponder i cannot edit the text in the text field?

like [self setStringValue:mad:"bla"]; does nothing at all in the resignFirstResponder method.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.