49
edits
(Created page with 'Derived from: Button Elements: CheckedTexture, DisabledCheckedTexture Attributes: checked Note: For checkb…') |
m (→Example) |
||
| Line 1: | Line 1: | ||
{{uixmlelem}} | |||
== Inheritance == | |||
: Inherited by: none, Inherits: <[[XML/Button|Button]]>, Runtime object: [[UIOBJECT_CheckButton|CheckButton]] | |||
: Defined in: [[XML/Frames|Frames]], [[XML/Ui|Ui]] | |||
== Elements == | |||
* <[[XML/CheckedTexture|CheckedTexture]]> | |||
* <[[XML/DisabledCheckedTexture|DisabledCheckedTexture]]> | |||
== Attributes == | |||
* checked | |||
== Details == | |||
For checkbuttons, setting the label of the checkbutton works differently from normal buttons. Using MyCheckButton:SetText("monkey"); will not give you a visible result. Instead, you need to address the text property of the checkbuttons invisible FontString frame. The FontString frame is named "<nowiki><checkButtonName></nowiki>Text", so to address it, use the following Lua code: | |||
getglobal(MyCheckButton:GetName() .. "Text"):SetText("Monkey"); | getglobal(MyCheckButton:GetName() .. "Text"):SetText("Monkey"); | ||
== Example == | |||
Included in [[XML/Backdrop|Backdrop]] | |||
<pre> | |||
<CheckButton name="$parentCheckButton" inherits="OptionsCheckButtonTemplate" checked="true"> | |||
<Anchors> | |||
<Anchor point="LEFT"> | |||
<Offset> | |||
<AbsDimension x="20" y="0" /> | |||
</Offset> | |||
</Anchor> | |||
</Anchors> | |||
</CheckButton> | |||
</pre> | |||
[[Image:wow_checkbutton.jpg]] | |||
[[Image: | |||
[[Category:XML elements]] | [[Category:XML elements]] | ||