DNumSlider.OnValueChanged

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel.OnValueChanged( Panel, Value )
Where is this used?
Description:
Called every time DNumSlider changes value.
Returns: Panel Number
In Object: Panel
Part of Library: DNumSlider
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DNumSlider.OnValueChanged]DNumSlider.OnValueChanged [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints a message to console when the value changes.
Used onNewerClient.png
Code
local DermaPanel = vgui.Create( "DFrame" )
DermaPanel:SetPos( 50,50 )
DermaPanel:SetSize( 200, 250 )
DermaPanel:SetTitle( "Testing Derma Stuff" )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()
 
local NumSlider = vgui.Create( "DNumSlider", DermaPanel )
NumSlider:SetPos( 25,50 )
NumSlider:SetWide( 150 )
NumSlider:SetText( "Max Props" )
NumSlider:SetMin( 0 )
NumSlider:SetMax( 256 )
NumSlider:SetDecimals( 0 )
NumSlider:SetConVar( "sbox_maxprops" )
 
NumSlider.OnValueChanged = function( panel, value )
print( "NumSliders value has changed!" ) -- Prints to console when the numsliders value changes.
end   
 
OutputPrints "NumSliders value has changed!" each time the sliders value changes.
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox