API ScriptRegion HookScript

Securely post-hooks a widget script handler.
 success = ScriptRegion:HookScript(scriptTypeName, script [, bindingType])
==Arguments==
:;scriptTypeName: - Name of the script type, for example "OnShow".
:;script: - The function that will be called.
:;bindingType: - The intrinsic frame precall/postcall handler.
==Returns==
:;success: - True if the script was successfully hooked.
==Details==
* If the script type doesn't have an existing handler, this will be equivalent to .
* Any hooks applied will remain in place until the UI is reloaded. But the original script can still be removed with SetScript(scriptType, nil).
==Example==
Prints when you open the character frame.
/run CharacterFrame:HookScript("OnShow", function(self) print(self:GetName().." was shown") end)
Prints when ChatFrame1 is shown by e.g. switching between chat tabs.
ChatFrame1:HookScript("OnShow", function(self)
	print("OnShow")
end)
ChatFrame1:HookScript("OnShow", function(self)
	print("OnPostShow")
end, LE_SCRIPT_BINDING_TYPE_INTRINSIC_POSTCALL)
==Patch history==
==See also==
* ()