Skip to content

Constructing Your Application

Brian Spencer edited this page Jun 17, 2017 · 1 revision

Once you have created an application project with the Levure project creator you can start constructing your application in your app folder.

The Levure framework automatically loads stacks for you based on where the stack files are stored in your app folder and the settings in app.yml. Note that whenever you add, remove, or move files or folders around you will need to restart the LiveCode IDE and reload your application with standalone.livecode for the changes to take effect.

Steps in constructing your application

Set application data folder in app.yml

A common first step in constructing your application is to set the application data folder value in the app.yml file. This is required if you are using preferences in your application.

Set preferences filename in app.yml

After setting the application data folder you can set the preferences filename value in app.yml. If you leave this value blank your application will not support preferences.

Using preferences requires the "[[FRAMEWORK]]/helpers/preferences" helper.

Add a user interface stack

User interface (UI) stacks are visible binary LiveCode stacks that your user interacts with while running your application. Each UI stack and its associated behaviors is stored in its own folder within the ui folder in your app folder.

When you first create your application project with the Levure project creator, a sample UI stack is provided in the sample_window folder in the app/ui folder. Typically you will delete the sample_window folder and add your own UI stack folder(s) into the ui folder.

Open a user interface stack when application launches

To open a user interface stack when the application launches, edit your app.livecodescript script-only stack and add a go stack ... command to the OpenApplication handler.

Example:

script "app"
# This is the app.livecodescript script
...
on OpenApplication
  go stack "Document Editor"
end OpenApplication
...

Customize app.livecodescript

In addition to opening a user interface stack, you will typically edit and customize app.livecodescript to perform other actions during your application startup and shutdown. For example, you might want to perform initialization operations during application startup and cleanup operations during application shutdown.

Add libraries, behaviors, frontscripts and backscripts

You add libraries, behaviors, frontscripts and backscripts to your application simply by adding the script-only or binary stacks to the corresponding folder in your app folder. Library stacks go in the app/libraries folder, behaviors go in app/behaviors, frontscripts go in app/frontscripts, and backscripts go in app/backscripts.

The next time you open your application in the LiveCode IDE the stacks will be loaded correctly based on the folder they are in.

Add helpers

Add externals

Add extensions

Add other assets


NEXT: Packaging Your Application

Clone this wiki locally