A extension library is written in much the same way as the above widget. The only diļ¬erence is that all the public handlers implemented are inserted into the message path when the extension is loaded. For example, here is a simple library with one handler which simply returns the string "Hello W orld!":
library community.livecode.elanorb.helloworld metadata title is "Hello World Library" metadata author is "Elanor Buchanan" metadata version is "1.0.0" public handler sayHello() return "Hello World!" end handler end library
Once this is compiled and loaded, the sayHello handler would be in the message path, before the backscripts. LiveCode Builder library handlers can be invoked in both command and function form:
sayHello put the result -- outputs "Hello World!" put sayHello() -- outputs "Hello World!"
Loading and Creating Widgets Manually
To load a compiled module file call:
load extension <filepath.lcm>
To create a widget from script call:
create widget <name> as <identifier>
e.g.
create widget "myWidget" as "com.livecode.extensions.waddingham.clock"
# Next