API ScriptRegion SetScript

Sets the widget script handler.
 ScriptRegion:SetScript(scriptTypeName, script)
==Arguments==
:;scriptTypeName: - Name of the script type, for example "OnShow".
:;script: - The script handler to call or explicitly nil to remove any existing script.
==Details==
* Setting a script will remove any scripts that were previously hooked with .
==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)