WoW:API Frame SetScript: Difference between revisions

Factual correction
(Update link to additional widget handlers)
(Factual correction)
Line 11: Line 11:


:;handler : String - The handler to attach func to (OnShow, OnEvent, [[Widget_handlers|et al]])
:;handler : String - The handler to attach func to (OnShow, OnEvent, [[Widget_handlers|et al]])
:;func : Function - The function to call.  <tt>nil</tt> to remove the handler. <tt>func</tt> is called with arguments <tt>(frame, event, arg1, arg2, ...)</tt>
:;func : Function - The function to call.  <tt>nil</tt> to remove the handler. <tt>func</tt> is called with arguments <tt>(frame, arg1, arg2, ...)</tt> (<tt>event</tt> being <tt>arg1</tt> for OnEvent handlers)


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


Anonymous user