XML/CheckButton
< XML
Jump to navigation
Jump to search
<CheckButton> (inherits from <Button>, creates a CheckButton) adds a 'checked' state.
<CheckButton> <CheckedTexture /> <DisabledCheckedTexture /> </CheckButton>
Attributes
- checked (boolean? ) - True shows the texture; false hides it.
Child elements
<CheckedTexture> appears when checked; inherits <Texture>.
<DisabledCheckedTexture> appears when checked and disabled; inherits <Texture>.
Details
- Note: For checkbuttons, setting the label of the checkbutton works differently from normal buttons.[citation needed] 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"></AbsDimension>
</Offset>
</Anchor>
</Anchors>
</CheckButton>