Livecode Wiki

Specifies whether a group behaves as a background and come after it's card on the message path. It becomes the background of all cards! Tab panels should be always set this way (making them a group).


set the backgroundBehavior of <group> to {true | false}


set the backgroundBehavior of group 1 to false
set the backgroundBehavior of the last group to true
if the backgroundBehavior of group "backgroundObjects" is true then
 -- do something
end if

Use the backgroundBehavior property to make groups behave like backgrounds and to automatically place these groups on newly created cards.

Only top-level groups may be background groups; an attempt to set the backgroundBehavior of a nested group to true throws an error.

A background group differs from a normal group in the following ways:

Place group example

  • The group can be placed onto multiple cards. To place a background in a card use the IDE menu bar: Object -> Place Group
  • 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.

A background group is also a shared group. This means that when the backgroundBehavior is set to true, the sharedBehavior is also set to true (if it is not already).

Setting the backgroundBehavior of a group to false does not affect the sharedBehavior property, in particular the latter is not be set to false until it is explicitly done so.

Only groups whose backgroundBehavior is true appear in the list reported by the backgroundNames and backgroundIDs properties.

If a stack created in a version of LiveCode earlier than 1.1 is opened in 1.1 or later, the backgroundBehavior of all its groups is set to true by default. This also applies to imported HyperCard stacks.

See also: preOpenBackground (message), openControl (message), openBackground (message), closeBackground (message), preOpenControl (message), closeControl (message), HCAddressing (property), sharedBehavior (property), backgroundNames (property), backgroundIDs (property), dynamicPaths (property),