WoWWiki

This wiki contains inaccurate and out-of-date information. Please head over to https://wowpedia.fandom.com for more accurate and up-to-date game information.

READ MORE

WoWWiki
WoWWiki
Advertisement

Widget API ← Frame < SetScript

Sets an event handler for a specific event type for this frame.

frame:SetScript("handler", func)

Parameters[]

Arguments[]

handler
string - the name of the handler type, like 'OnShow', 'OnClick'. See Widget_handlers.
func
function - the Lua function to call or 'nil' to remove the handler

Examples[]

for i = 1, 4 do
    local frame = _G["PartyMemberFrame"..i]
    frame:SetScript("OnShow", frame.Hide)
end

Adds an 'OnShow' event handler to all party frames to be called whenever they're shown.

PartyMemberFrame1:SetScript("OnShow", nil)

Removes whatever 'OnShow' handler was set from 'PartyMemberFrame1'.

See also[]

Advertisement