WoW:API CheckButton SetChecked: Difference between revisions

m
Move page script moved page API CheckButton SetChecked to WoW:API CheckButton SetChecked without leaving a redirect
({{widgetmethod}})
m (Move page script moved page API CheckButton SetChecked to WoW:API CheckButton SetChecked without leaving a redirect)
 
(7 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{widgetmethod}}
{{widgetmethod}} __NOTOC__
{{stub/api}}


Sets the status of a CheckButton. Set to 1 for checked status, or 0 for unchecked.
Sets the checked status of a CheckButton frame.
CheckButton:SetChecked(State);
 
== Parameters ==
=== Arguments ===
:;state :{{api|boolean|t=t}} - 'true' sets the button state to checked. Default is 'false'.
 
=== Returns ===
: none
 
== Examples ==
CheckButton:SetChecked(true)
 
Button is checked
 
CheckButton:SetChecked(false)
CheckButton:SetChecked(0)
CheckButton:SetChecked(nil)
CheckButton:SetChecked()
CheckButton:SetChecked({1,2,3})
CheckButton:SetChecked("true")
 
Button is unchecked
 
== Notes ==
* Passing "nil" will uncheck the button, but passing *no* argument (although it should end up being nil for Lua) will enable it, also passing a table ({...}) will now check the button.
* As of WoW 6.0 both GetChecked() and SetChecked() use Lua boolean values only. Passing value other than Lua {{api|boolean|t=t}} 'true' is the same as passing 'false', and GetChecked() will only return true or false.  Prior to 6.0.2 values such as true, 1, -2397, {1,2,3}, "foo" would all set state as checked. Values such as false, 0, nil would set state as not checked.
 
== See also ==
* {{api|CheckButton:GetChecked|t=w}}
Anonymous user