<?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%3APageWindowAddPageBreak</id>
	<title>API:PageWindowAddPageBreak - 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%3APageWindowAddPageBreak"/>
	<link rel="alternate" type="text/html" href="https://wiki.returnofreckoning.com/index.php?title=API:PageWindowAddPageBreak&amp;action=history"/>
	<updated>2026-10-17T01:29:12Z</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:PageWindowAddPageBreak&amp;diff=30620&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:PageWindowAddPageBreak&amp;diff=30620&amp;oldid=prev"/>
		<updated>2026-10-16T19:47:28Z</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;
Marks a window inside a PageWindow as a page break, so that it always starts a new page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
PageWindowAddPageBreak(pageWindowName, breakWindowName)&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;
;breakWindowName : &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; – Name of the window that should start a new page. It is normally a window inside the PageWindow&amp;#039;s content.&lt;br /&gt;
&lt;br /&gt;
== Returns ==&lt;br /&gt;
Nothing.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
* The window is added to the PageWindow&amp;#039;s list of page breaks. Nothing is laid out by this call; the list is used the next time the pages are laid out with [[API:PageWindowUpdatePages|PageWindowUpdatePages]].&lt;br /&gt;
* During layout, a page-break window that is not already at the top of a page is moved to the top of the next page, together with everything below it.&lt;br /&gt;
* If &amp;lt;code&amp;gt;breakWindowName&amp;lt;/code&amp;gt; does not exist, the call does nothing. No error is raised for it.&lt;br /&gt;
* A window that is already in the list is not added a second time, so calling the function again for the same window is harmless.&lt;br /&gt;
* When [[API:PageWindowUpdatePages|PageWindowUpdatePages]] splits a Label across two pages, the client creates a Label named &amp;#039;&amp;#039;labelName&amp;#039;&amp;#039;&amp;lt;code&amp;gt;_pgbrk&amp;lt;/code&amp;gt; for the continued text and adds it to this list itself. The stock Tome of Knowledge checks for such a window with &amp;lt;code&amp;gt;DoesWindowExist( &amp;quot;BestiarySpeciesInfoText1_pgbrk&amp;quot; )&amp;lt;/code&amp;gt;.&lt;br /&gt;
* The function needs at least two arguments and only reads the last two. Any extra arguments placed in front of them are ignored.&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
* &amp;lt;code&amp;gt;Error in function call &amp;#039;PageWindowAddPageBreak&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;PageWindowAddPageBreak&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;: remove a break, re-lay out the pages, and add the break back only if the text was not split:&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;
if( not DoesWindowExist( &amp;quot;BestiarySpeciesInfoText1_pgbrk&amp;quot; ) )&lt;br /&gt;
then&lt;br /&gt;
    WindowSetShowing( &amp;quot;BestiarySpeciesDivider&amp;quot;, false )&lt;br /&gt;
    PageWindowAddPageBreak( &amp;quot;BestiarySpeciesInfoPageWindow&amp;quot;, &amp;quot;BestiarySpeciesTaskAnchor&amp;quot; )&lt;br /&gt;
    PageWindowUpdatePages( &amp;quot;BestiarySpeciesInfoPageWindow&amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[API:PageWindowRemovePageBreak|PageWindowRemovePageBreak]]&lt;br /&gt;
* [[API:PageWindowClearPageBreaks|PageWindowClearPageBreaks]]&lt;br /&gt;
* [[API:PageWindowUpdatePages|PageWindowUpdatePages]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>