<?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%3AWindowResizeOnChildren</id>
	<title>API:WindowResizeOnChildren - 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%3AWindowResizeOnChildren"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:WindowResizeOnChildren&amp;action=history"/>
	<updated>2026-10-18T06:58:51Z</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:WindowResizeOnChildren&amp;diff=30890&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:WindowResizeOnChildren&amp;diff=30890&amp;oldid=prev"/>
		<updated>2026-10-16T19:51:46Z</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;
Resizes a window so that its right and bottom edges enclose its child windows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
WindowResizeOnChildren(windowName, recurse, borderSpacing)&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 to resize.&lt;br /&gt;
;recurse : &amp;lt;code&amp;gt;boolean&amp;lt;/code&amp;gt; – &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; to also look at the children of the children, all the way down.&lt;br /&gt;
;borderSpacing : &amp;lt;code&amp;gt;number&amp;lt;/code&amp;gt; – Extra space added to the right and bottom.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The client finds the right-most and bottom-most edge of the child windows, adds &amp;lt;code&amp;gt;borderSpacing&amp;lt;/code&amp;gt;, and sets the window&amp;#039;s width and height so that its right and bottom edges are there. The window&amp;#039;s top-left corner does not move.&lt;br /&gt;
* The window can grow or shrink.&lt;br /&gt;
* Only child windows whose showing flag is set and which have fewer than two anchors are measured. Children with two or more anchors (for example ones stretched across the window) are ignored.&lt;br /&gt;
* With &amp;lt;code&amp;gt;recurse = true&amp;lt;/code&amp;gt;, the children of measured children are measured as well.&lt;br /&gt;
* The new size is set as with [[API:WindowSetDimensions|WindowSetDimensions]], so the same limits and side effects apply. The window&amp;#039;s own anchors are processed afterwards.&lt;br /&gt;
* The stock UI shows a dialog before calling this function on it. Its comment says that it does not work otherwise.&lt;br /&gt;
* The &amp;#039;&amp;#039;No window specified&amp;#039;&amp;#039; error exists in the client but cannot be raised: a missing name is replaced by an empty string first, which gives the &amp;#039;&amp;#039;does not exist&amp;#039;&amp;#039; error.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;WindowResizeOnChildren&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;WindowResizeOnChildren&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;
-- Show the Dialog.&lt;br /&gt;
-- This must be done before WindowResizeOnChildren -- it doesn&amp;#039;t work otherwise.&lt;br /&gt;
WindowSetShowing( &amp;quot;OneButtonDlg&amp;quot;..dlgIndex, true )&lt;br /&gt;
&lt;br /&gt;
WindowResizeOnChildren( &amp;quot;OneButtonDlg&amp;quot;..dlgIndex..&amp;quot;Box&amp;quot;, false, 10 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:WindowSetDimensions|WindowSetDimensions]]&lt;br /&gt;
* [[API:WindowGetDimensions|WindowGetDimensions]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>