Panel.AppendText

From GMod Wiki

Jump to: navigation, search
Function
Syntax Panel:AppendText( String text )
Description:
Appends text to the panel
Returns: nil
In Object: Panel
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Panel.AppendText]Panel.AppendText [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Additional Notes

-- We don't want a newline appended right away as it takes an empty line, so we hack it up.
local appendNL=false
local AppendText=yourcontrol.AppendText
function yourcontrol:AppendText(txt)
	if appendNL then
		txt='\n'..txt
	end
	if txt:sub(-1)=="\n" then
		appendNL=true
		txt = txt:sub(1,txt:len()-1)
	else
		appendNL=false
	end
 
	AppendText(self,txt)
end
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox