Garry's Mod Wiki

Garry's Mod Wiki

  DTextEntry:OnLoseFocus()

Description

Called whenever the DTextEntry lose focus.

Example

concommand.Add( "test_textentry_onlosefocus", function(ply) local frame = vgui.Create( "DFrame" ) frame:SetSize( 400, 200 ) frame:Center() frame:MakePopup() local default = "Brick with bob" local textentry = vgui.Create( "DTextEntry", frame ) textentry:SetText( default ) textentry:Dock( TOP ) textentry.OnLoseFocus = function( self ) if ( self:GetText() == "" ) then self:SetText( default ) end end end )
Output: DTextEntry value reset to default value if the text entered is empty.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...