Garry's Mod Wiki

Revision Difference

Panel:ConVarStringThink#510582

<function name="ConVarStringThink" parent="Panel" type="classfunc">⤶ <description>⤶ A think hook for [panels](/gmod/Panel) using ConVars as a value. Call it in the Think hook. Sets the panel's value should the convar change.⤶ ⤶ This function is best for: text inputs, read-only inputs, dropdown selects⤶ ⤶ For a number alternative, see [Panel.ConVarNumberThink](/gmod/Panel/ConVarNumberThink).⤶ ⤶ `Important`: Make sure your Panel has a SetValue function, else you may get errors.⤶ </description>⤶ <realm>Client</realm>⤶ </function>⤶ ⤶ <example>⤶ <description>How it should be implemented into your input.</description>⤶ <code>⤶ function PANEL:Think()⤶ self:ConVarStringThink()⤶ end⤶ </code>⤶ <output>Panel's value is changed when the convar changes.</output>⤶ ⤶ </example>