Detect when a field changes

Mark Wieder mwieder at ahsoftware.net
Tue Nov 19 18:04:54 CET 2013


Robert-

Tuesday, November 19, 2013, 6:38:16 AM, you wrote:

> Bill, if you always need to call the extra function after changing
> the field, why don't you write a function that does both and then you
> have only a single line to enter and nothing to forget?

That's my take on this as well. Backward compatibility would break in
some serious ways if the textChanged message were triggered also in
the case of text changes by script. If you're changing a field's text
by script then by default you already know the text is changing. If
you need to have something happen to text whether the change came from
the engine or from a script, I would deal with this situation thusly:

on textChanged
  doTheTextChangedThing
end textChanged

on whatever
  put someText into someField
  doTheTextChangedThing
end whatever

-- 
-Mark Wieder
 ahsoftware at gmail.com




More information about the use-livecode mailing list