<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ALabelGetText</id>
	<title>API:LabelGetText - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.returnofreckoning.com/index.php?action=history&amp;feed=atom&amp;title=API%3ALabelGetText"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:LabelGetText&amp;action=history"/>
	<updated>2026-10-17T18:28:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.returnofreckoning.com/index.php?title=API:LabelGetText&amp;diff=30549&amp;oldid=prev</id>
		<title>Maintenance script: UI Lua API import (WAR 1.4.8)</title>
		<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:LabelGetText&amp;diff=30549&amp;oldid=prev"/>
		<updated>2026-10-16T19:46:22Z</updated>

		<summary type="html">&lt;p&gt;UI Lua API import (WAR 1.4.8)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LuaApi|group=Label|wrapper=interfacecore/source/windowstate.lua}}&lt;br /&gt;
Returns the text shown by a Label.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
text = LabelGetText(labelName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;labelName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of a Label window.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
;text : &amp;lt;code&amp;gt;wstring&amp;lt;/code&amp;gt; – The label&amp;#039;s text.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The client registers the C function as &amp;lt;code&amp;gt;_LabelGetText&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;LabelGetText&amp;lt;/code&amp;gt; that addons call is a Lua function defined in &amp;lt;code&amp;gt;interfacecore/source/windowstate.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
** If the global table named after the window (&amp;lt;code&amp;gt;_G[labelName]&amp;lt;/code&amp;gt;) has a &amp;lt;code&amp;gt;STATE&amp;lt;/code&amp;gt; table, it returns &amp;lt;code&amp;gt;STATE.LABEL_TEXT&amp;lt;/code&amp;gt; without calling into the client.&lt;br /&gt;
** Otherwise it calls &amp;lt;code&amp;gt;_LabelGetText(labelName)&amp;lt;/code&amp;gt;.&lt;br /&gt;
* For windows with state tracking enabled, the client writes the new text to &amp;lt;code&amp;gt;&amp;#039;&amp;#039;labelName&amp;#039;&amp;#039;.STATE.LABEL_TEXT&amp;lt;/code&amp;gt; each time the text changes, for example through [[API:LabelSetText|LabelSetText]].&lt;br /&gt;
* &amp;lt;code&amp;gt;_LabelGetText&amp;lt;/code&amp;gt; returns the text as it is displayed, not necessarily the exact string that was passed to [[API:LabelSetText|LabelSetText]]: the client processes the displayed copy and shortens it if it is longer than the label&amp;#039;s maximum length.&lt;br /&gt;
* If an addon creates a global table with the same name as a label and gives it a &amp;lt;code&amp;gt;STATE&amp;lt;/code&amp;gt; field, &amp;lt;code&amp;gt;LabelGetText&amp;lt;/code&amp;gt; returns whatever that field&amp;#039;s &amp;lt;code&amp;gt;LABEL_TEXT&amp;lt;/code&amp;gt; holds. Avoid using &amp;lt;code&amp;gt;STATE&amp;lt;/code&amp;gt; as a field name on window tables.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
Raised by &amp;lt;code&amp;gt;_LabelGetText&amp;lt;/code&amp;gt;:&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;LabelGetText&amp;#039;: Window %s does not exist&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;LabelGetText&amp;#039;: Window %s is not a Label&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
Checking whether a tooltip line has text, from &amp;lt;code&amp;gt;easystem_tooltips/source/itemtooltips.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local hasExtraText  = LabelGetText( tooltipWindow..&amp;quot;ActionText&amp;quot; ) ~= L&amp;quot;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:LabelSetText|LabelSetText]]&lt;br /&gt;
* [[API:LabelGetTextDimensions|LabelGetTextDimensions]]&lt;br /&gt;
* [[API:ButtonGetText|ButtonGetText]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>