Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Advertisement


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. func is called with arguments (frame, event, arg1, arg2, ...)

Example

for i = 1, 4 do
    local frame = getglobal("PartyMemberFrame"..i)
    frame:SetScript("OnShow", function(self) self:Hide() end)
end

Result

All party frames will be hidden whenever they're shown.

PartyMemberFrame1:SetScript("OnShow", nil)

Result

Removes the OnShow handler from PartyMemberFrame1.


Advertisement