Open main menu
Home
Random
Log in
Settings
About AddOn Studio
Disclaimers
AddOn Studio
Search
Editing
WoW:USERAPI Frame SetManyAttributes
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{usermethod}} Small function to be attached to secure frames to allow for setting many attributes in a single call. local function SetManyAttributes(self, ...) for i=1,select("#", ...),2 do local att,val = select(i, ...) if not att then return end self:SetAttribute(att,val) end end == Example == local frames = {} for i=1,12 do frames[i] = CreateFrame("Button", nil, UIParent, "SecureActionButtonTemplate") frames[i].SetManyAttributes = SetManyAttributes end frames[1]:SetManyAttributes("type1", "macro", "macrotext", "/equip Hydrocane") frames[2]:SetManyAttributes("type1", "spell", "spell", "Greater Heal") Or to just use the function on a random frame: SetManyAttributes(someFrame, "type1", "macro", "macrotext", "/equip Hydrocane");
Summary:
Please note that all contributions to AddOn Studio are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
AddOn Studio Wiki:Copyrights
for details).
Submissions must be written by you, or copied from a public domain or similar free resource (see
AddOn Studio Wiki:Copyrights
for details).
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Apinav
(
edit
)
Template:Editlink
(
edit
)
Template:Notebox
(
edit
)
Template:Usermethod
(
edit
)