Garry's Mod Wiki

Garry's Mod Wiki

  DCheckBoxLabel:OnChange( boolean bVal )

Description

Called when the "checked" state is changed. This is meant to be Overriden

Arguments

1 boolean bVal
Whether the checkbox is checked or unchecked.

Example

Creates a a DCheckBoxLabel that prints to the console when ticked/unticked

local Frame = vgui.Create( "DFrame" ) Frame:SetSize( 300, 100 ) Frame:SetPos( 200, 200 ) local LabelBox = vgui.Create( "DCheckBoxLabel", Frame ) LabelBox:SetPos( 10, 40 ) LabelBox:SetText( "This is a DLabel" ) function LabelBox:OnChange( val ) if val then print( "The box has been ticked!" ) else print( "The box has been unticked!" ) end end
Output: The box has been ticked!

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...