Re: Read Text Field's Contents Real-Time: textDidChange?
Re: Read Text Field's Contents Real-Time: textDidChange?
- Subject: Re: Read Text Field's Contents Real-Time: textDidChange?
- From: Shane Stanley <email@hidden>
- Date: Wed, 14 Jul 2010 11:41:51 +1000
- Thread-topic: Read Text Field's Contents Real-Time: textDidChange?
On 14/7/10 11:00 AM, "Nathan Greenstein" <email@hidden> wrote:
> I've got a text field, and I want to be immediately (i.e. the user doesn't
> have to change the focus) notified of a change to its contents.
> I think that textDidChange is what I want, but I've never used that kind of
> thing in ASOC before. How do I put it in?
To use textDidChange: you would have to subclass the text field. It's easier
to make your script the delegate of the text field, which you can do in
Interface Builder. Then you can implement the NSControl delegate method
controlTextDidChange:
on controlTextDidChange_(notif)
...
To distinguish between text fields, you can do something like this:
on controlTextDidChange_(notif)
if notif's object() = textFieldVar then
-- that's the one we want
--
Shane Stanley <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden