DCheckBox/OnChange

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Fixed the page)
(Checked argument was forgotten - added argument and changed example)
Line 3: Line 3:
 
|Parent=DCheckBox
 
|Parent=DCheckBox
 
|Description=Called when the "checked" state is changed.
 
|Description=Called when the "checked" state is changed.
 +
}}
 +
{{Arg
 +
|type=boolean
 +
|name=bVal
 +
|desc=Whether the CheckBox is checked or not.
 
}}
 
}}
 
{{Example
 
{{Example
|Code=function DCheckBox:OnChange()
+
|Code=function DCheckBox:OnChange(bVal)
   print("It's changed!")
+
   if (bVal) then
 +
      print("Checked!")
 +
  else
 +
      print("Unchecked!")
 +
  end
 
end
 
end
 
}}
 
}}

Revision as of 21:20, 11 September 2014

 DCheckBox:OnChange( )

Contents

DescriptionPanelFunc

Called when the "checked" state is changed.

Arguments

boolean bVal

Whether the CheckBox is checked or not.

Examples

Example

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


Personal tools
Navigation