API ScriptObject SetScript

Sets the widget's script handler. ScriptObject:SetScript(scriptType, handler)

Arguments

 * scriptType : - Name of the script type, e.g. "OnShow".
 * handler : - The function to call when handling the specified widget event, or   to remove any existing script.

Details

 * Removes any scripts that were previously hooked with

Examples
Sets the OnEvent script for a Frame; which prints when your character starts moving.