Garry's Mod Wiki


  Panel:SetConVar( string convar )


This function does not exist on all panels
This function cannot interact with serverside convars unless you are host
Blocked convars will not work with this, see Blocked ConCommands

Sets this panel's convar. When the convar changes this panel will update automatically.

For developer implementation, see Derma_Install_Convar_Functions.


1 string convar
The console variable to check.


Makes a checkbox linked to the cl_drawhud convar.

local DermaPanel = vgui.Create( "DFrame" ) DermaPanel:SetPos( 100, 100 ) DermaPanel:SetSize( 300, 200 ) DermaPanel:SetTitle( "My new Derma frame" ) DermaPanel:SetDraggable( true ) DermaPanel:MakePopup() local Checkbox = vgui.Create( "DCheckBoxLabel", DermaPanel ) Checkbox:SetConVar( "cl_drawhud" ) Checkbox:SetText( "Enable HUD?" ) Checkbox:SetPos( 5, 25 ) Checkbox:SizeToContents()