WoW:XML/CheckButton: Difference between revisions
< XML
(Created page with 'Derived from: Button Elements: CheckedTexture, DisabledCheckedTexture Attributes: checked Note: For checkb…') |
m (Move page script moved page XML/CheckButton to XML/CheckButton without leaving a redirect) |
||
| (One intermediate revision by one other user not shown) | |||
| 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]] | ||
Latest revision as of 04:49, 15 August 2023
← XML UI ← XML elements < CheckButton
Inheritance
- Inherited by: none, Inherits: <Button>, Runtime object: CheckButton
- Defined in: Frames, Ui
Elements
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 "<checkButtonName>Text", so to address it, use the following Lua code: getglobal(MyCheckButton:GetName() .. "Text"):SetText("Monkey");
Example
Included in Backdrop
<CheckButton name="$parentCheckButton" inherits="OptionsCheckButtonTemplate" checked="true">
<Anchors>
<Anchor point="LEFT">
<Offset>
<AbsDimension x="20" y="0" />
</Offset>
</Anchor>
</Anchors>
</CheckButton>