WoW:API Frame SetScript: Difference between revisions

Update link to additional widget handlers
(Update link to additional widget handlers)
Line 10: Line 10:
:("handler", func)
:("handler", func)


:;handler : String - The handler to attach func to (OnShow, OnEvent, [[XML_User_Interface#Event_Handler_reference|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, event, arg1, arg2, ...)</tt>


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


Anonymous user