<doc>
	<legacy_id>1362</legacy_id>
	<name>backgroundBehavior</name>
	<type>property</type>

	<syntax>
		<example>set the backgroundBehavior of <i>group</i> to {true | false}</example>
	</syntax>

	<synonyms>
		<synonym>bgBehavior</synonym>
	</synonyms>

	<summary>Specifies whether a group behaves as a background and come after it's card on the message path.</summary>

	<examples>
<example>set the backgroundBehavior of group 1 to false</example>
<example>set the backgroundBehavior of the last group to true</example>
<example><p>if the backgroundBehavior of group &quot;backgroundObjects&quot; is true then</p><p> -- do something</p><p>end if</p></example>
	</examples>

	<history>
		<introduced version="1.1">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="4.6.4">Changed.</changed>
	</history>

	<objects>
		<group/>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Objects &amp; Messages</category>
	</classification>

	<references>
		<command tag="place">place Command</command>
		<command tag="send">send Command</command>
		<property tag="backgroundIDs">backgroundIDs Property</property>
		<property tag="backgroundNames">backgroundNames Property</property>
		<property tag="dynamicPaths">dynamicPaths Property</property>
		<property tag="HCAddressing">HCAddressing Property</property>
		<message tag="preOpenBackground">preOpenBackground Message</message>
		<message tag="openBackground">openBackground Message</message>
		<message tag="closeBackground">closeBackground Message</message>
		<control_st tag="pass">pass Control Structure</control_st>
	</references>

	<description>
	<overview>Use the <b>backgroundBehavior</b> property to make groups behave like backgrounds and to automatically place groups on newly created cards.</overview>

		<parameters>
		</parameters>

	<value>The <b>backgroundBehavior</b> of a group is true or false.<p></p><p>By default, the <b>backgroundBehavior</b> property of newly created groups is set to false.</p></value>
	<comments>Only top-level groups may be background groups; an attempt to set the <b>backgroundBehavior</b> of a nested group to true throws an error.<p></p><p>A background group differs from a normal group in the following ways:</p><p>  * The group's script is placed behind the card in the message path for any message not originating from a control within it.</p><p>  * The group can be referred to using the 'background' chunk.</p><p>  * The card on which the group is placed receives <message tag="preOpenBackground">preOpenBackground</message>/<message tag="openBackground">openBackground</message>/<message tag="closeBackground">closeBackground</message> messages (these messages occur instead of <message tag="preOpenControl">preOpenControl</message>/<message tag="openControl">openControl</message>/<message tag="closeControl">closeControl</message> being sent to the group itself).</p><p>  * The group can be placed onto multiple cards.</p><p>  * If the group is placed on 'this card' at the time a new card is created, it is automatically placed onto the new (empty) card.</p><p></p><p>A background group is also a shared group. This means that when the <b>backgroundBehavior</b> is set to true, the <property tag="sharedBehavior">sharedBehavior</property> is also set to true (if it is not already).</p><p></p><p></p><note>Setting the <b>backgroundBehavior</b> of a group to false does not affect the <property tag="sharedBehavior">sharedBehavior</property> property, in particular the latter is not be set to false until it is explicitly done so.</note><p></p><p></p><note>Only groups whose <b>backgroundBehavior</b> is true appear in the list reported by the <property tag="backgroundIDs">backgroundNames</property> and <property tag="backgroundIDs">backgroundIDs</property> properties.</note><p></p><p></p><note>If a stack created in a version of LiveCode earlier than 1.1 is opened in 1.1 or later, the <b>backgroundBehavior</b> of all its groups is set to true by default. This also applies to imported HyperCard stacks.</note></comments>
	</description>
</doc>