OnChange function since v0.1 ¶
Given a property name, returns a special key which connects to that property's change events. It should be used with a handler callback, which may accept the new value of the property.
(propertyName: string) -> SpecialKey
Parameters¶
propertyName
- The name of the property to listen for changes to.
Returns¶
A special key which runs at the observer
stage. When applied to an instance,
it connects to the property change signal on the instance for the given property.
The handler is run with the property's value after every change.
Example Usage¶
New "TextBox" {
[OnChange "Text"] = function(newText)
print("You typed:", newText)
end
}