Widget API: Frame:GetAttribute

From AddOn Studio
Revision as of 18:14, 1 June 2009 by WoWWiki>Starlightblunder (Created page with '{{widgetmethod}} Returns the value of a specific attribute (or an attribute matching the prefix/suffix arguments). value = frame:GetAttribute(name); value = frame:GetAttribute(...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Widget API ← Frame < GetAttribute

Returns the value of a specific attribute (or an attribute matching the prefix/suffix arguments).

value = frame:GetAttribute(name);
value = frame:GetAttribute(prefix, name, suffix);

Arguments

prefix
String - modifier prefix string: a concatenation of alt-, ctrl-, and shift-, whichever apply, in that order.
name
Attribute name. If passes as the only attribute, this may be a fully qualified value; otherwise, it is the unmodified name of the attribute being retrieved.
suffix
String - button suffix string: either a numeric string or a dash followed by an arbitrary button name.

Returns

value
Mixed - the value of the matching attribute; nil if no attribute matched the arguments.

Matching order

When invoked with three arguments, this function attempts to return attributes in the following order (returning the first attribute that exists):

  1. prefix .. name .. suffix
  2. "*" .. name .. suffix
  3. prefix .. name .. "*"
  4. "*" .. name .. "*"
  5. name