Frame:SetID

From Warcraft Wiki
Jump to navigation Jump to search
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Frame:GetID
GitHub Octocat.png  Dragonflight-Icon-Inline.png  BTNTemp.png  Wowprogramming.png Frame:SetID

Sets a numeric identifier for the frame.

Frame:SetID(id)

Arguments

id
integer

Details

  • Frame IDs can be a useful way to keep track of multiple similar frames, especially in cases where a list of frames is created from a template (such as for loot slots, or lines in a FauxScrollFrame); or when frames might be constructed in a different order than they appear.
  • For example, ContainerFrame1 is the bag frame nearest the bottom-right corner of the screen. However, its ID changes to indicate which bag it represents.
  • For action buttons that inherit SecureActionButtonTemplate, if the button is configured to trigger an action and its Frame ID is greater than zero then the ID will be used instead of the "action" attribute