mainStackChanged

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
mainStackChanged
Associationsstack
Summary

Sent to a stack when its mainStack is changed.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
on mainStackChanged -- in a main stack's script
  save me -- save the stack file when a substack is added
end mainStackChanged
RelatedProperty: mainStack
Object: stack
Glossary: substack, stack file, message, handler, handle, development environment
Control Structure: pass
Description

Handle the mainStackChanged message if you want to respond when a substack is moved to another stack file.

Each stack file consists of a main stack, and may also include one or more substacks. To move a stack to another file, you set its mainStack property to the name of the main stack of the destination file. The moved stack becomes a substack of the main stack you specified.

The mainStackChanged message is sent right after the stack is moved to the new stack file. This means that (if the substack does not trap the message) the mainStackChanged message is received by the new main stack, and can be handled in the main stack's script.

The mainStackChanged message is used by the LiveCode development environment, so if you handle this message, be sure to pass it at the end of the handler.

Tagsobjects