DTextEntry.SetEnterAllowed

From GMod Wiki

Jump to: navigation, search
Function
Syntax DTextEntry:SetEnterAllowed( Boolean allowed )
Where is this used?
Description:
Sets whether or not the OnEnter function will run.
Returns: nil
Part of Library: DTextEntry
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=DTextEntry.SetEnterAllowed]DTextEntry.SetEnterAllowed [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionChanges the OnEnter function.
Used onNewerClient.png
Code
local TextEntry = vgui.Create( "DTextEntry", DermaPanel )
    TextEntry:SetPos(20, 30)
    TextEntry:SetTall( 20 )
    TextEntry:SetWide( 160 )
    TextEntry:SetEnterAllowed( false ) -- Below code will not be run, as this is false.
    TextEntry.OnEnter = function()
        chat.AddText( "hello")
    end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox