![]() |
The API is no longer being updated here until further notice. |
Sets the widget script handler.
ScriptRegion:SetScript(scriptTypeName, script)
Arguments
- scriptTypeName
- string - Name of the script type, for example "OnShow".
- script
- function|nil - The script handler to call or explicitly
nilto remove any existing script.
Details
- Setting a script will remove any scripts that were previously hooked with HookScript.
Example
Sets the OnEvent script; this prints when your character starts moving.
local function OnEvent(self, event)
print(event)
end
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_STARTED_MOVING")
f:SetScript("OnEvent", OnEvent)
