FANDOM


Widget API ← EditBox < SetText


Sets editBox's text to the specified string.

editBox:SetText(str)


Arguments Edit

str (string) -- the string you want to appear in the EditBox

Returns Edit

nil

Details Edit

You should call a SetText("") every time you read from an EditBox, so the command line is free for the next input.

SetText fails when the text contains characters that aren't renderable (e.g. control chars, invalid UTF8). In that case the EditBox is cleared and EditBox:GetText() returns the empty string.

Before Battle-Logo-Small Battle for Azeroth, unrenderable chars were displayed as '?'.[citation needed]

See Also Edit

Community content is available under CC-BY-SA unless otherwise noted.