< Previous | Contents | Next >
Notify Change
The NotifyChanged event function is executed any time a control is changed on a tool. It executes before the Process event function. Typically the NotifyChanged event is used to adjust the values of controls before they are locked for rendering.

For example, the NotifyChanged function may be used to show and hide controls, or modify the name of a UI Label on a control in this example.
-- Notify Changed: Hide or Show controls and change Labels when options are selected
function NotifyChanged(inp, param, time)
-- If Notify Change check box changes then rename Control names and Un/Hide sliders
if inp == InNotify then
local locked = (param.Value > 0.5)
InSliderH:SetAttrs({ LINKS_Name = "Slider Hide/Show" }) InSliderH:SetAttrs({ IC_Visible = true }) InNotify:SetAttrs({ LINKS_Name = "Notify Change Showing" })
else
InSliderH:SetAttrs({ LINKS_Name = "Slider Hide/Show Hidden" }) InSliderH:SetAttrs({ IC_Visible = false }) InNotify:SetAttrs({ LINKS_Name = "Notify Change Hidden" })
end
end
end