DCheckBox/OnChange

From Garry's Mod
Jump to: navigation, search
 DCheckBox:OnChange( )

Contents

DescriptionPanelHook

Called when the "checked" state is changed.

Arguments

boolean bVal

Whether the CheckBox is checked or not.

Examples

Example

Creates a metamethod on the DCheckBox class to print any changes to the console.

function DCheckBox:OnChange(bVal)
	if (bVal) then
		print("Checked!")
	else
		print("Unchecked!")
	end
end

Output:

All new checkboxes created will print Checked! or Unchecked! when their checked state is changed.
Personal tools
Navigation