Welcome and introduction to LiveCode Builder

LiveCode Builder is a language for extending LiveCode's capabilities, creating new object types as Widgets, and libraries that access lower-level APIs in OSes, applications, and DLLs.

Moderators: LCMark, LCfraser

Post Reply
LCfraser
Livecode Staff Member
Livecode Staff Member
Posts: 71
Joined: Thu Nov 28, 2013 11:18 am
Contact:

Welcome and introduction to LiveCode Builder

Post by LCfraser » Thu Mar 12, 2015 6:00 pm

LiveCode Builder is the new language introduced in LiveCode 8.0 for writing widgets and other extensions.

To get started with LiveCode Builder (LCB), click on the "Dictionary" icon in the IDE toolbar, select the "Guide" tab and then "Extending LiveCode" from the drop-down menu. This will show you the user-guide on getting started with writing widgets in LCB. Alternatively, you can start by looking at some of the widgets shipped with LiveCode 8 - the source and other resources for these are located in the "extensions" sub-folder of your LiveCode installation directory (source files are named *.lcb and can be edited with a text editor of your choice).

If you're eager to get started, here's a quick run down of how things work in LCB:

Creating and editing extensions

LCB uses a different development model to LiveCode Script - it is a write-then-compile system: you write a source .lcb file which is compiled with the lc-compile tool to produce a bytecode .lcm module which then gets packaged together with any required resources (icons, documentation, images, etc) into a .lce extension package.

Step 1: writing your extension

LiveCode currently does not include a built-in editor for .lcb source files but, because they are plain text files, they can be written using any text editor. There are two forms of extensions that you can write: widgets, which are controls like the existing built-in controls (buttons, progress bars, etc); and libraries, which add new commands and functions to the engine.

Please see the LiveCode Builder user guide for information on how to write code in LCB.

Step 2: building and packaging your extension

The easiest way to build and package your extension is to use the "Extension Builder" IDE plugin; this can be accessed through the Developer -> Plugins menu in the IDE. Use the folder icon at the top right to open your .lcb file then press the "Test" button to compile and load your module. If your module was a widget, a new stack will pop up containing that widget.

Once you are happy with your code, press the "Package" button to produce an extension package. This step may print out a number of warnings into the log field if you haven't included the metadata required by the LiveCode extension store.

If you press the "Install" button, your extension will be installed into the "Extensions" directory of your "My LiveCode" folder and will now be available to you whenever you run the LiveCode IDE.

Step 3: the LiveCode extension store

Of course, you may want to share the widget you've just written. To do this, we are providing the LiveCode Extension Store to host widgets you have created. For more details on the store and how to upload your widgets to it, please see http://www.livecode.com/products/extensions

That's it

We're all very excited to see what new widgets and libraries you all come up with. If you have a question, observation or just want to show something off, post it here for all to see.

Regards,
The LiveCode Team

Post Reply

Return to “LiveCode Builder”