Repositories: LILGUI
Main | Log | Branches | Tags | Bugs | Wiki | Login

LILGUI is a specification for applications that use LIL as an extension language to provide a simple GUI API that scripts can use to create windows, dialogs and embedded panels. LazLILGUI is an implementation of the LILGUI spec for Lazarus and Free Pascal based on FPLIL.

Like LIL was inspired by Tcl but remained focused on being a simple extension scripting language, LILGUI is loosely inspired by Tk but again with the focus on being used mainly for extending an existing GUI that the host application has, as opposed to creating the entire GUI using it.

Here is a simple example of LILGUI code:

group ; grid
label 'Title' ; choice {Mr Ms} mrs
label 'First Name' ; edit first
label 'Middle Name' ; edit mid
label 'Last Name' ; edit last
space ; checkbox 'Show middle' sm
parent up
button Confirm {
    local mm ; set mm [if $sm {quote '$mid '}]
    msgbox "Hello [index {Mr. Ms.} $mrs] $first ${mm}$last"

This will create the field shown on the right and when the "Confirm" button is clicked, it will show a message box saying something like Hello Mr. Someone Nice.

LILGUI works mainly by binding variables to controls. The scripts can use these variables after the fact (for dialogs) or use the watch function to watch the variables for any change. For example the following code will print the value of the slider in the standard output (or whatever output the host application has set up):

slider foo ; watch foo { print foo is $foo }

This is the LILGUI Fossil repository and contains:

   © 2009‑2017 Kostas Michalopoulos