-
Notifications
You must be signed in to change notification settings - Fork 14
Constructing Your Application
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.
- Set application data folder in app.yml
- Set preferences filename in app.yml
- Add a user interface stack
- Open a user interface stack when application launches
- Customize app.livecodescript
- Add libraries, behaviors, frontscripts and backscripts
- Add helpers
- Add externals
- Add extensions
- Add other assets
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.
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.
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.
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
...
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.
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.
- Learn about adding libraries
- Learn about adding behaviors
- Learn about adding frontscripts and backscripts
Levure is an application development framework written for LiveCode.