DTextEntry.OnTextChanged

From GMod Wiki

Jump to: navigation, search
Function
Syntax DTextEntry:OnTextChanged( Panel TextEntry Object )
Where is this used?
Description:
Called when the text in a DTextEntry is changed.
Returns: nil
Part of Library: DTextEntry
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DTextEntry.OnTextChanged]DTextEntry.OnTextChanged [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionAlert the user each time the text is changed.
Used onNewerClient.png
Code
local main = vgui.Create("DFrame")
main:SetSize(300,50)
main:MakePopup()
main:Center()
 
local Entry = vgui.Create("DTextEntry",main)
Entry:SetPos(25,15)
Entry:SetMultiline(false)
Entry.OnTextChanged = function(PanelVar) -- Passes a single argument, the text entry object.
    LocalPlayer():ChatPrint("Text changed to \""..Entry:GetValue().."\"")
end
OutputN/A

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox