WoW:API Frame SetScript: Difference between revisions
Jump to navigation
Jump to search
Frame:SetScript -Documentation by Author-
(needed a link to the darn handler events. (insert colorful language here)) |
({{widgetmethod}}) |
||
Line 1: | Line 1: | ||
{{widgetmethod}} | |||
<center>'''Frame:SetScript''' ''-Documentation by [[user:Author|Author]]-''</center> | <center>'''Frame:SetScript''' ''-Documentation by [[user:Author|Author]]-''</center> | ||
Line 27: | Line 29: | ||
__NOTOC__ | __NOTOC__ | ||
Revision as of 12:00, 10 June 2006
← Widget API ← Frame < SetScript
Sets the action handler for this frame.
frame:SetScript("handler", function)
Parameters
Arguments
- ("handler", func)
- handler
- String - The handler to attach func to (OnShow, OnEvent, et al)
- func
- Function - The function to call. nil 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.