<doc>
  <legacy_id>2316</legacy_id>
  <name>closeBackground</name>
  <type>message</type>
  <syntax>
    <example>closeBackground <i>backgroundID</i></example>
  </syntax>
  <library></library>
  <objects>
    <card/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Navigation &amp; Hypertext</category>
  </classification>
  <references>
    <message tag="openBackground">openBackground Message</message>
    <message tag="closeStack">closeStack Message</message>
    <message tag="preOpenBackground">preOpenBackground Message</message>
    <message tag="closeCard">closeCard Message</message>
    <message tag="shutdown">shutdown Message</message>
  </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 user is leaving a <keyword tag="card">card</keyword> that has a <command tag="group">group</command> to go to one that doesn't have the <command tag="group">group</command>.</summary>
  <examples>
    <example>on closeBackground theClosedGroupID</p><p><code><i>-- save when exiting a particular background:</i></code></p><p>  if theClosedGroupID is 234 then saveNotesToFile</p><p>  pass closeBackground</p><p>end closeBackground</example>
  </examples>
  <description>
    <p>Handle the <b>closeBackground</b> <keyword tag="message box">message</keyword> if you want to perform cleanup or do other tasks when the user leaves a <object tag="group">background</object>.</p><p/><p><b>Parameters:</b></p><p>The <i>backgroundID</i> is the ID number of the <object tag="group">background</object> being exited.</p><p/><p><b>Comments:</b></p><p>A background is closed when the user either goes to a card that doesn't have the group on it, or closes the stack.</p><p/><p>The <b>closeBackground</b> <keyword tag="message box">message</keyword> is sent only if the <glossary tag="group">group's</glossary> <property tag="backgroundBehavior">backgroundBehavior</property> <glossary tag="property">property</glossary> is set to true. If the <glossary tag="group">group's</glossary> <property tag="backgroundBehavior">backgroundBehavior</property> is false, no <message tag="closeBackground">closeBackground</message> <keyword tag="message box">message</keyword> is sent, even if the <command tag="group">group</command> is placed on multiple <glossary tag="card">cards</glossary>.</p><p/><p>A separate <b>closeBackground</b> <keyword tag="message box">message</keyword> is sent for each <object tag="group">background</object> that is being closed.</p>
  </description>
</doc>