WoW:XML/KeyValues

From AddOn Studio
< XML
Revision as of 00:36, 6 December 2014 by Bear (talk | contribs) (Created page with "{{uixmltype}} KeyValues holds a list of KeyValue elements, and is a mechanism for adding members to Lua objects that represent the UI eleme...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

XML UI ← XML properties < KeyValues

KeyValues holds a list of KeyValue elements, and is a mechanism for adding members to Lua objects that represent the UI element. KeyValues can be defined in any LayoutFrame type.

Inheritance

Inherited by: none, Inherits: none, Defined in: LayoutFrame

Elements

<KeyValue> ...

Attributes

none

Summary

KeyValues allow XML to define Lua variables for the runtime UI object representing the element. Defining an attribute will actually set a member of the elements object table of the defined type. UI the default WoW UI FrameXML Attributes are often used to define security attributes as setting those attributes before the frame is available, insures that the element is secured before any other scripts can access it.

Example

<Frame name="MyFrame">
  <KeyValues>
    <KeyValue key="myvar" value="0" type="number"/>
  </KeyValues>
</Frame>

This example will set a variable named 'myvar' with a number value of '0', when the frame is created.