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.
+
In engine is only implemented for {{Type|CheckButton}}, {{Type|Label}} (limited to 8192 characters) and {{Type|TextEntry}} as a string.
  
{{Note|This function is limited to 8092 Bytes. If using {{Type|DTextEntry}}, use {{ClassFunction|Panel|GetText}} for unlimited bytes.}}
+
If using with {{Type|DTextEntry}}, you should use {{ClassFunction|Panel|GetText}} instead.
 
+
{{NextUpdate|DTextEntry is no longer affected by the limit}}
+
 
|Realm=Client
 
|Realm=Client
 
|IsClass=Yes
 
|IsClass=Yes

Latest revision as of 16:13, 21 January 2020

 Panel:GetValue( )

Contents

Description

Returns the value the panel holds.

In engine is only implemented for CheckButton, Label (limited to 8192 characters) and TextEntry as a string.

If using with DTextEntry, you should use Panel:GetText instead.

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