<?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%3AWindowSetDimensions</id>
	<title>API:WindowSetDimensions - 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%3AWindowSetDimensions"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowSetDimensions&amp;action=history"/>
	<updated>2026-10-18T04:52:43Z</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:WindowSetDimensions&amp;diff=30893&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:WindowSetDimensions&amp;diff=30893&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:49Z</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=Window}}&lt;br /&gt;
Sets a window&amp;#039;s width and height.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowSetDimensions(windowName, width, height)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;windowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window.&lt;br /&gt;
;width, height : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – New size, before the window&amp;#039;s scale is applied.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The size is in the window&amp;#039;s own units. On screen it is multiplied by the window&amp;#039;s scale ([[API:WindowGetScale|WindowGetScale]]).&lt;br /&gt;
* Negative values are stored as 0.&lt;br /&gt;
* For windows that are kept fully on screen (see [[API:WindowIsSticky|WindowIsSticky]]), the width and height are also limited to the screen size divided by the window&amp;#039;s scale.&lt;br /&gt;
* If the size does not change, nothing else happens. Otherwise:&lt;br /&gt;
** For windows with state tracking enabled, &amp;lt;code&amp;gt;&amp;#039;&amp;#039;windowName&amp;#039;&amp;#039;.STATE.DIMENSION_X&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;DIMENSION_Y&amp;lt;/code&amp;gt; are updated (see [[API:WindowGetDimensions|WindowGetDimensions]]).&lt;br /&gt;
** The client can call the window&amp;#039;s &amp;lt;code&amp;gt;OnSizeUpdated&amp;lt;/code&amp;gt; core event handler (see [[API:WindowRegisterCoreEventHandler|WindowRegisterCoreEventHandler]]) with the new width and height.&lt;br /&gt;
* Afterwards the window&amp;#039;s own anchors are processed again. A window with two anchors on opposite corners therefore gets its size back from the anchors; clear or change the anchors to resize it.&lt;br /&gt;
* The root window cannot be resized.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetDimensions&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;WindowSetDimensions&amp;#039;: The dimensions of the root window cannot be changed.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowSetDimensions&amp;#039;: Window %s is currently locked and may not be modified from lua. ...&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;This check never triggers in the current client. See [[API:WindowSetShowing|WindowSetShowing]].&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;easystem_dialogmanager/source/dialogmanager.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local x, y = WindowGetDimensions( &amp;quot;OneButtonDlg&amp;quot;..dlgIndex..&amp;quot;Box&amp;quot; )&lt;br /&gt;
WindowSetDimensions ( &amp;quot;OneButtonDlg&amp;quot;..dlgIndex, x, y )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowGetDimensions|WindowGetDimensions]]&lt;br /&gt;
* [[API:WindowResizeOnChildren|WindowResizeOnChildren]]&lt;br /&gt;
* [[API:WindowSetScale|WindowSetScale]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>