<?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%3APageWindowUpdatePages</id>
	<title>API:PageWindowUpdatePages - 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%3APageWindowUpdatePages"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:PageWindowUpdatePages&amp;action=history"/>
	<updated>2026-10-17T03:37:32Z</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:PageWindowUpdatePages&amp;diff=30630&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:PageWindowUpdatePages&amp;diff=30630&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:37Z</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=PageWindow}}&lt;br /&gt;
Lays out a PageWindow&amp;#039;s content across its pages and recounts the pages.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PageWindowUpdatePages(pageWindowName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
;pageWindowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the PageWindow.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* Call this after changing the content of a PageWindow (text, shown windows, page breaks). The page count is not updated until you do.&lt;br /&gt;
* The child windows of the PageWindow&amp;#039;s content are placed page by page, top to bottom:&lt;br /&gt;
** A window that starts on a page but runs past its bottom is moved to the top of the next page, together with everything below it. A window that already starts at the top of a page is left where it is, even if it is taller than the page.&lt;br /&gt;
** A window registered with [[API:PageWindowAddPageBreak|PageWindowAddPageBreak]] always starts a new page.&lt;br /&gt;
** A window registered with [[API:PageWindowAddSplitableWindow|PageWindowAddSplitableWindow]] is not moved; a copy named &amp;#039;&amp;#039;windowName&amp;#039;&amp;#039;&amp;lt;code&amp;gt;_pgbrk&amp;lt;/code&amp;gt; is created instead.&lt;br /&gt;
** Some Labels are split instead of moved: the lines that fit stay on the page, and the rest of the text goes into a new Label named &amp;#039;&amp;#039;labelName&amp;#039;&amp;#039;&amp;lt;code&amp;gt;_pgbrk&amp;lt;/code&amp;gt; at the top of the next page. That new Label is also added to the page-break list.&lt;br /&gt;
* After the layout, the page count is recalculated (see [[API:PageWindowGetNumPages|PageWindowGetNumPages]]) and the content is resized so that all pages sit side by side.&lt;br /&gt;
* The current page is then set again, which clamps it to the new page count (see [[API:PageWindowSetCurrentPage|PageWindowSetCurrentPage]]).&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;PageWindowUpdatePages&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;PageWindowUpdatePages&amp;#039;: Window %s is not a PageWindow&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
From &amp;lt;code&amp;gt;default/ea_tomeofknowledge/source/tomewindow_bestiary.lua&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PageWindowRemovePageBreak( &amp;quot;BestiarySpeciesInfoPageWindow&amp;quot;, &amp;quot;BestiarySpeciesTaskAnchor&amp;quot; )&lt;br /&gt;
PageWindowUpdatePages( &amp;quot;BestiarySpeciesInfoPageWindow&amp;quot; )&lt;br /&gt;
...&lt;br /&gt;
PageWindowSetCurrentPage( &amp;quot;BestiarySpeciesInfoPageWindow&amp;quot;, 1 )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:PageWindowGetNumPages|PageWindowGetNumPages]]&lt;br /&gt;
* [[API:PageWindowSetCurrentPage|PageWindowSetCurrentPage]]&lt;br /&gt;
* [[API:PageWindowAddPageBreak|PageWindowAddPageBreak]]&lt;br /&gt;
* [[API:PageWindowAddSplitableWindow|PageWindowAddSplitableWindow]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>