Thursday, December 14, 2017

#1 2009-09-14 07:57:55 am

robdut
Member
Registered: 2009-09-02
Posts: 301

text field edited calls

Hi All,

Now I am trying to have a handler called when Text is changed in a text field.

I found the method

Applescript:

controlTextDidChange_()

and read :

"An NSTextField can be assigned a delegate, who is
then informed of delegate messages sent by the
window's field editor, such as textShouldEndEditing:."

but am getting confused how to implement this after trying a few things..

inching along,  Rob

Offline

 

#2 2009-09-14 08:28:40 am

Craig Williams
Administrator
From:: Ft. Smith, AR
Registered: 2006-12-07
Posts: 888

Re: text field edited calls

Add the following to the file you want to be the text field's delegate.

Applescript:

   on controlTextDidEndEditing_(Notification)
       log "Notification ended editing"
   end controlTextDidEndEditing_

In IB, control-drag from the text field to the file's instance and select delegate.

Offline

 

#3 2009-09-14 08:44:54 am

robdut
Member
Registered: 2009-09-02
Posts: 301

Re: text field edited calls

That's Perfect.

I was close but left out the "(notification)"

Thanks Craig, Rob

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)