LiveCode
  • Why LiveCode?
  • Customers
  • Resources
  • Education
  • Consulting
  • Pricing
  • Blog
  • Login
  • Try LiveCode
Back to
  • slides
  • tutorial
Resources

Introduction

Topic Progress:
← Back to Lesson

LiveCode Builder Extensions

In this lesson we will create a minimal LiveCode Builder library which extends the set of commands and functions available in LiveCode.

We will

  • Install and configure an appropriate text editor for developing in LiveCode Builder.
  • Create a Hello World library which extends LiveCode with a single function, which returns the string “Hello World!”. Compile the library.
  • Install the library into the LiveCode IDE.
  • Include the library in a standalone.

LiveCode Builder Extensions

LiveCode 8.0 is the most exciting release in the history of the technology. It provides a simple way to extend the functionality or control set of LiveCode.

Our focus in LiveCode 8.0 is extensibility. You can now build and share widgets (custom controls) and libraries that are treated by LiveCode as engine level elements.

To make it possible to create extensions and plug them into the LiveCode engine we’ve created a new flavour of our language called LiveCode Builder. LiveCode Builder looks a lot like LiveCode Script so should feel familiar for any seasoned LiveCode developer. There is lots of new syntax which exposes parts of the LiveCode engine that were only previously available to those who were skilled C/C++ developers.

Note: LiveCode Builder is a different flavour of LiveCode so it is not possible to edit LiveCode Builder source code in the main LiveCode Script IDE.

Libraries and Widgets

There are two types of extensions that can be created with LiveCode Builder:

Libraries: A library can be used to extend the set of commands and functions available in LiveCode. The public handlers in a library are added at the bottom of the Message Path.

Widgets: A widget is a custom control that is treated as an engine level element. Widgets appear in the Tools Palette and can be added as controls to any LiveCode stack.

A widget and a library are identical, except that a widget draws to a canvas. As a result, the authoring process is much the same for both extension types.

When to use LiveCode Builder

Why write widgets?

Encapsulation – Widgets are ‘black boxes’ whose behavior can only be changed from LiveCode apps via predefined API Features – Access to drawing / low-level / native APIs Performance – Can control what recalculations are made when a control is redrawn

What are (LCB) libraries?

Libraries are scripts written in LiveCode Builder, whose public handlers are placed at the back of the message path when installed.

LCB libraries make LCB features available to LiveCode apps directly. They can also be used as support code for widgets.

LiveCode Builder API

The API for LiveCode Builder is available in the Dictionary stack. You may find it useful to have this open while you are writing your extension.

  • Open the Dictionary from the Menubar.
  • Ensure you are on the API pane.
  • Select LiveCode Builder from the drop down menu.

Next Topic →
  •  
  •  
  • (0)
  •  

Expand All | Collapse All
Lessons Status
1 - Hello World Library
  • Introduction
  • Installing a Text Editor
  • Creating an LCB library
  • LCB library definition
  • LCB handler definitions
  • Compiling and testing a library in LiveCode
  • LCB metadata
  • Installing an LCB Library
  • Packaging and sharing an LCB library
  • Including an LCB library in a standalone
  • Conclusion
2 - Extended Hello World Library
  • Introduction
  • Explicit Types
  • LCB Lists and Arrays
  • Type Conversion between LCB and LiveCode Script
  • Using Explicit Typing in the Library
  • Passing Parameters to the Library
  • Using Lists in the Library
  • Documenting the Library
  • Browsing the Documentation
  • Conclusion
3 - Rotated Text Widget
  • Introduction
  • Defining a Widget
  • LCB Module Level Variables
  • Widget Properties
  • Widget Handlers
  • LCB Canvas Operations
  • Compiling and Testing the Widget
  • Installing the Widget and adding it to a Stack
  • Including the Widget in a Standalone
  • Conclusion
4 - Extended Rotated Text Widget
  • Introduction
  • Integrating Properties
  • Accessing LiveCode Control Properties
  • Handling Mouse Events
  • Saving and Loading Widgets
  • Read Only Properties
  • Documenting the Widget
  • Conclusion
5 - Pie Chart Widget
  • Introduction
  • Planning the Widget
  • Widget Properties
  • The OnCreate Handler
  • The OnPaint Handler
  • Responding to Mouse Events
  • Saving and Loading the Widget
  • Installing and Including the Widget in a Standalone
  • Documenting the Widget
  • Conclusion
6 - Modifying the Line Graph Widget
  • Introduction
  • Duplicating the Line Graph Widget
  • Additional Color Properties
  • Filling the area below the line
  • Adding graph marker mouse events
  • Conclusion
7 - Additional Resources
  • Extending LiveCode Guide
  • LiveCode Builder Language Reference
  • LiveCode Builder Style Guide
  • LiveCode Documentation Format
 

All Slides

All Slides
 

Login

LiveCode

  • Why LiveCode?
  • Pricing
  • Customer Stories
  • Extensions
  • LiveCode in Education
  • LiveCode in Business

Looking for LiveCode FileMaker?

LiveCode for FM

Resources

  • Docs
  • API (Language Dictionary)
  • Lessons
  • Sample Stacks
  • Forums
  • Stackoverflow
  • User Groups
  • Support
  • Directory
  • LiveCode Services

About

  • About
  • Meet The Team
  • Careers at LiveCode
  • Contact us

Recent Posts

  • LiveCode Classic 10.0.1 Stable and 10.0.2-rc-1 Released
  • Create Progress – the Three D’s
  • LiveCode Create: Closing out the year with big steps forward
  • Create dp-5: Unified Engines and Shared Extensions
  • 3 Great New LiveCode Releases
Sitemap
Terms Privacy Policy EULA
Brought to you by LiveCode Ltd, Registered in Scotland, No. SC200728
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok