Garry's Mod Wiki

DCheckBox:OnChange

DCheckBox:OnChange( boolean bVal )

Description

Called when the "checked" state is changed.

Arguments

1 boolean bVal
Whether the CheckBox is checked or not.

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.

Page Links


Special Pages


Wikis

?

Render Time: 31ms

Session 0
DB GetPage 5
Generate Html 4
SaveChanges 9
Render Body 0
Render Sidebar 11