Panel/GetValue

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
Line 2: Line 2:
 
|Description=Returns the value the panel holds.
 
|Description=Returns the value the panel holds.
  
In engine is only implemented for {{Type|CheckButton}}, {{Type|Label}} and {{Type|TextEntry}} as a string and for those elements has a hard coded limit of 8092 characters.
+
In engine is only implemented for {{Type|CheckButton}}, {{Type|Label}} and {{Type|TextEntry}} as a string.
  
{{Note|This function is limited to 8091 Bytes. If using {{Type|DTextEntry}}, use {{ClassFunction|Panel|GetText}} for unlimited bytes.}}
+
{{Note|This function is limited to 8092 Bytes. If using {{Type|DTextEntry}}, use {{ClassFunction|Panel|GetText}} for unlimited bytes.}}
 +
 
 +
{{NextUpdate|DTextEntry is no longer affected by the limit}}
 
|Realm=Client
 
|Realm=Client
 
|IsClass=Yes
 
|IsClass=Yes

Revision as of 00:50, 4 January 2020

 Panel:GetValue( )

Contents

Description

Returns the value the panel holds.

In engine is only implemented for CheckButton, Label and TextEntry as a string.

NOTE

This function is limited to 8092 Bytes. If using DTextEntry, use Panel:GetText for unlimited bytes.


Next Update Change

DTextEntry is no longer affected by the limit

Returns

any

The value the panel holds.

Examples

Example

Returns the string typed in a TextEntry.

local TextEntry = vgui.Create( "TextEntry" )
TextEntry:SetText( "Hello world!" )
print( TextEntry:GetValue() )

Output:

"Hello world!"
Personal tools
Navigation