Panel/SetActionFunction

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(added arg name for better typegen and consistency)
Line 18: Line 18:
 
* {{FuncArg|string|action|"Command" on button press, "SliderMoved" on slider move.}}
 
* {{FuncArg|string|action|"Command" on button press, "SliderMoved" on slider move.}}
 
* {{FuncArg|number|val|The new value of the {{Type|Slider}}. Will always equal 0 for buttons.}}
 
* {{FuncArg|number|val|The new value of the {{Type|Slider}}. Will always equal 0 for buttons.}}
* {{FuncArg|number||Always equals 0.}}
+
* {{FuncArg|number|zed|Always equals 0.}}
 
}}
 
}}

Revision as of 08:34, 13 September 2019

 Panel:SetActionFunction( )

Description

This feature is deprecated.
You should avoid using it as it may be removed in a future version.

Only used in deprecated Derma controls.

Used in Button to call a function when the button is clicked and in Slider when the value changes.

Arguments

function func

Function to call when the Button is clicked or the Slider value is changed.

Arguments given are:

  • Panel self - The panel itself
  • string action - "Command" on button press, "SliderMoved" on slider move.
  • number val - The new value of the Slider. Will always equal 0 for buttons.
  • number zed - Always equals 0.
Personal tools
Navigation