UIOBJECT CheckButton

CheckButton (inherits from ) comprises a box beside a text label. Interacting with anything within the HitRectInsets toggles the button state between checked and not checked appearances.
===Lua===
With "CheckButton" as the first argument in 
local cb = CreateFrame("CheckButton", "MyCheckButton", UIParent)
===XML===
With a element in an XML file.
<CheckButton name="MyCheckButton" parent="UIParent">
	<!-- insert anchors, scripts, children and other components here in XML -->
</CheckButton>
==Methods==
==Scripts==
==Example==
The following example provides a basic CheckButton inheriting a common template to configure its default appearance.
local myCheckButton = CreateFrame("CheckButton", nil, UIParent, "ChatConfigCheckButtonTemplate")
myCheckButton:SetPoint("TOPLEFT", 200, -65)
myCheckButton.Text:SetText("CheckBox Name")
myCheckButton.tooltip = "This is where you place MouseOver Text."
myCheckButton:HookScript("OnClick", function()
	--do stuff
end)
The following example creates a "checkbox-factory function" to automate several steps (but could be substituted using a FramePoolMixin):
local function createCheckButton(parent, xOff, yOff, displayname)
	local checkButton = CreateFrame("CheckButton", nil, parent, "ChatConfigCheckButtonTemplate");
	checkButton:SetPoint("TOPLEFT", xOff or 0, yOff or 0);
	checkButton.Text:SetText(displayname or "");
	return checkButton;
end
local myCheckButton = createCheckButton(UIParent, 400, -600, "A Checkbox");
myCheckButton.tooltip = "If this is checked, nothing will happen, because this is a demo checkbox.";
myCheckButton:HookScript("OnClick", function()
	-- do stuff
end);
== Patch changes ==
* 
== References ==