How do I modify a LiveCode widget

What do you do if a LiveCode widget is missing a property or message you need?

The source code for all the widgets provided 'out of the box' is accessible so you can take those widgets as a base and improve and extended them as you need.

In this lesson we will see how to prepare for adding features to the Line Graph widget.

Make a copy of the widget source

The first step is to make a copy of the Line Graph LCB source

  • Create a new folder
  • Copy the graph.lcb file from a LiveCode executable. The file can be found inside the LiveCode executable in

Tools/Extensions/com.livecode.widget.linegraph

  • Set the properties of the copied file so it can be edited

Open the new LCB file

Open the new LCB file in your preferred text editor.

I am using Atom as it has a LiveCode package that provides colorization and indenting but any text editor will work for writing LCB.

Update the widget definition

Now update the widget metadata

  • Set the widget identifier
  • Set the author
  • Set the version
  • Set the title
  • Set the icon svg path

Customize the widget

Now you are ready to make the changes you need to the line graph.

For an example of modifying the line chart see this blog post by Monte Goulding.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.