WoW:API EditBox SetText: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
== Details ==
== Details ==
You should call a SetText("") every time you read from an EditBox, so the command line is free for the next input.
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 [[API EditBox GetText|EditBox:GetText()]] returns the empty string.
(Before WoW 8.0 unrenderable chars were displayed as '?')


== See Also ==
== See Also ==

Revision as of 14:22, 31 December 2018

Widget API ← EditBox < SetText


Sets editBox's text to the specified string.

editBox:SetText(str)


Arguments

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

Returns

nil

Details

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 WoW 8.0 unrenderable chars were displayed as '?')

See Also