ScriptObject:GetScript

From Warcraft Wiki
Jump to navigation Jump to search

Returns the widget script handler.

script = ScriptObject:GetScript(scriptTypeName [, bindingType])

Arguments

scriptTypeName
string - Name of the script type, for example "OnShow".
bindingType
number? - The intrinsic frame precall/postcall handler.
Value Enum Description
0 LE_SCRIPT_BINDING_TYPE_INTRINSIC_PRECALL
1 LE_SCRIPT_BINDING_TYPE_EXTRINSIC Default
2 LE_SCRIPT_BINDING_TYPE_INTRINSIC_POSTCALL

Returns

script
function? - The script handler, returns nil if none is set.

Example

Prints the OnShow script handlers from ChatFrame1.

print(ChatFrame1:GetScript("OnShow"))                                            -- "function: 000001EB64BE3D20"
print(ChatFrame1:GetScript("OnShow", LE_SCRIPT_BINDING_TYPE_INTRINSIC_POSTCALL)) -- "function: 000001EB88AB5800"