<doc>
  <legacy_id>1445</legacy_id>
  <name>closeStack</name>
  <type>message</type>
  <syntax>
    <example>closeStack</example>
  </syntax>
  <library></library>
  <objects>
    <card/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Windows &amp; Dialog Boxes</category>
    <category>User Interaction</category>
  </classification>
  <references>
    <message tag="suspendStack">suspendStack Message</message>
    <message tag="saveStackRequest">saveStackRequest Message</message>
    <message tag="closeCard">closeCard Message</message>
    <message tag="unIconifyStack">unIconifyStack Message</message>
    <message tag="preOpenStack">preOpenStack Message</message>
    <message tag="closeBackground">closeBackground Message</message>
    <message tag="closeStackRequest">closeStackRequest Message</message>
    <message tag="shutdown">shutdown Message</message>
    <property tag="closeBox">closeBox Property</property>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Sent to the <glossary tag="current card">current card</glossary> when the <object tag="stack">stack</object> closes.</summary>
  <examples>
    <example>on closeStack <code><i>-- automatically save changes</i></code></p><p>  save this stack</p><p>  pass closeStack</p><p>end closeStack</example>
  </examples>
  <description>
    <p>Handle the <b>closeStack</b> <keyword tag="message box">message</keyword> if you want to perform cleanup or do other tasks when the user closes a window.</p><p/><p><b>Comments:</b></p><p>A stack is closed when the user or a handler closes the stack window.</p><p/><p>The actual closing is not triggered by the <b>closeStack</b> <keyword tag="message box">message</keyword>, so <glossary tag="trap">trapping</glossary> the <keyword tag="message box">message</keyword> and not allowing it to <control_st tag="pass">pass</control_st> does not prevent the <object tag="stack">stack</object> from closing. To prevent a <object tag="stack">stack</object> from closing, <glossary tag="trap">trap</glossary> the <message tag="closeStackRequest">closeStackRequest</message> <keyword tag="message box">message</keyword>.</p>
  </description>
</doc>