no edit summary
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<center>'''Frame:SetScript''' ''-Documentation by [[user:Author|Author]]-''</center> | |||
Sets the action handler for this frame. | |||
frame:SetScript("handler", function) | |||
== Parameters == | |||
=== Arguments === | |||
<!-- List each argument, together with its type --> | |||
:("handler", func) | |||
:;handler : String - The handler to attach func to (OnShow, OnEvent, et al) | |||
:;func : Function - The function to call. <tt>nil</tt> to remove the handler. | |||
== Example == | |||
for i = 1, 4 do | |||
local frame = getglobal("PartyMemberFrame"..i) | |||
frame:SetScript("OnShow", function() this:Hide() end) | |||
end | |||
====Result==== | |||
All party frames will be hidden whenever they're show. | |||
PartyMemberFrame1:SetScript("OnShow", nil) | |||
====Result==== | |||
Removes the OnShow handler from PartyMemberFrame1. | |||
__NOTOC__ | |||
{{template:WoW API}} | {{template:WoW API}} | ||