Garry's Mod Wiki

Revision Difference

Panel:SetActionFunction#517743

<function name="SetActionFunction" parent="Panel" type="classfunc"> <description> <deprecated>Does nothing at all.</deprecated> Used in <page>Button</page> to call a function when the button is clicked and in <page>Slider</page> when the value changes. </description> <realm>Client</realm> <args> <arg name="func" type="function">Function to call when the &lt;page&gt;Button&lt;/page&gt; is clicked or the &lt;page&gt;Slider&lt;/page&gt; value is changed.&#xA;&#xA;Arguments given are:&#xA;* &lt;page&gt;Panel&lt;/page&gt; self - The panel itself&#xA;* &lt;page&gt;string&lt;/page&gt; action - &quot;Command&quot; on button press, &quot;SliderMoved&quot; on slider move.&#xA;* &lt;page&gt;number&lt;/page&gt; val - The new value of the &lt;page&gt;Slider. Will always equal 0 for buttons.&lt;/page&gt;&#xA;* &lt;page&gt;number&lt;/page&gt; zed - Always equals 0.</arg>⤶ <arg name="func" type="function">Function to call when the <page>Button</page> is clicked or the <page>Slider</page> value is changed.⤶ Arguments given are:⤶ * <page>Panel</page> self - The panel itself⤶ * <page>string</page> action - "Command" on button press, "SliderMoved" on slider move.⤶ * <page>number</page> val - The new value of the <page>Slider. Will always equal 0 for buttons.</page>⤶ * <page>number</page> zed - Always equals 0.</arg>⤶ </args> </function>