Skip to content

levure.livecodescript

Brian Spencer edited this page Mar 18, 2017 · 6 revisions

The levure/framework/levure.livecodescript stack file provides the primary framework functionality. When your application starts, the levure.livecodescript file is opened and its levureFramework script is attached to your standalone stack or executable as a behavior. The levureFramework script is then placed into the message path with start using so the framework handlers are globally accessible throughout your application.

levureFramework

The framework logic is located in the levureFramework stack script in the levure.livecodescript file. This script must be assigned as the behavior of another stack which is assumed to be the standalone.livecode stack. The levureInitializeAndRunApplication will initialize and load the framework. Here is what happens during loading:

  1. If an sAppA script local exists and the stack is running in the development environment then use values from that. It means the app has been packaged. Otherwise load the app.yml file, searching first alongside the standalone.livecode stack file and then directly within any folders that are alongside the standalone.livecode stack. If app.yml is not found then app cannot be loaded.
  2. Process any command line arguments using the app_files_and_urls helper (if app.yml explicitly loads this helper).
  3. Load app.livecodescript from folder containing the app.yml file.
  4. Load externals.
  5. Load helpers whose "preload" property is true. Any helper that ships with the framework is preloaded. When a helper is loaded all extensions, libraries, backscripts, and frontscripts that make up a helper will be loaded. UI stacks are added to list of stackFiles of the app stack.
  6. Create application data folders.
  7. Dispatch PreloadApplication to the app stack.
  8. Load remaining application assets. Extensions, libraries, backscripts, frontscripts are loaded into memory. UI stacks are added to list of stackFiles of the app stack.
  9. Dispatch InitializeApplication to app stack.
  10. Dispatch OpenApplication to app stack.

Clone this wiki locally