As soon as text changes...

Hello!

Is there any way of… as soon as text changes in a text field take the first letter and carry out a handler/action. I don’t mean once the entire text has been typed and a button has been pressed, as soon as text changes and one letter has been typed.

Any ideas? Any help would be appreciated! :slight_smile:

Hi,

implement this NSControl delegate method

  • (void)controlTextDidChange:(NSNotification *)aNotification

Thanks Stefan… but… how exactly do I use that?

connect the delegate of the text field to your controller class and add this handler:


on controlTextDidChange_(sender)
	log sender's object's stringValue()
end controlTextDidChange_

Woah! That’s brilliant! Thanks a lot! :smiley: