Widget/API/SetText

__NOTOC__
Sets the text value of a widget
Elem:SetText(text[r,g,b,warp])
== Parameters ==
=== Arguments ===
:Button, EditBox, FontString, Tooltip + child classes
:string
::New Text
:r, g, b (optional)
:: decimal number - values between 0 and 1 : Tooltip only
:: no number -> fallback to "1"
:warp
::boolean - Tooltip only
=== Returns ===
:nothing
== Example ==
/run Elem:SetText("text")
/run Elem.SetText(Elem, "text")
/run Tooltip:SetText("text",1,0,1,true)
== Issue ==
if you try SetText on any widget that hasn't at least empty
<OnLoad>
</OnLoad>
section in <Scripts></Scripts> then you get not informative error about "nil" value somewhere, it happens because part of the text that wider then widget will be replaced with dots
== Notes ==
* On Button Widgets, SetText has the side effect of resetting button text anchors.
== Related Pages ==
* Widget (Overview)
Category:Widget/API Category:Widget/Class/Button Category:Widget/Class/EditBox Category:Widget/Class/FontString Category:Widget/Class/GameTooltip