DCheckBox.GetChecked

From GMod Wiki

Jump to: navigation, search
Function
Syntax DCheckBox:GetChecked( )
Description:
Return the checkbox state.
Returns: Boolean
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DCheckBox.GetChecked]DCheckBox.GetChecked [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionCreates a Button on the new panel, and print a message with the checkbox state.
Used onNewerClient.png
Code
function PANEL:Init()
    self.CheckBox = vgui.Create("DCheckBox", self)
    self.CheckBox:SetText("Click me!")
    self.CheckBox:OnChange = function( chkBox )
        print(CheckBox:GetChecked() and "Checked" or "unChecked")
    end
end
OutputPrint the checkbox state in the console and in the chat area.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation