widgets.watch
Observes an exact reflected widget property.
Syntax
ue.widgets.watch(widget: UObjectProxy, property: string, callback: function, options?: table) -> integer?, string?Parameters
| Parameter | Type | Description |
|---|---|---|
widget | UObjectProxy | Widget to observe. |
property | string | Exact reflected property name. |
callback | function(value, old_value, widget, id, name) | Called when the value changes. |
options.immediate | boolean? | Deliver current state on the next tick. |
Returns
| Type | Description |
|---|---|
integer | Watch ID. |
nil, string | Property could not be read. |
Example
local id = assert(ue.widgets.watch(
widget,
"Visibility",
function(value, old_value)
print(old_value, value)
end
))Notes
- Requires a persistent session.