## Using the terminal

Here is a simple screenshot of a terminal interacting with the REPL (Read-Print-Eval Loop):

Note:
If you have the GNU library readline (or the Editline Library (aka libedit)) installed, you will be able to do line editing as in usual shells.

## Introduction to GUI Programming

STklos permits to easily program GUI (Graphical User Interfaces). To program a GUI, you need to install some packages which are available through the ScmPkg mechanism.

The packages can easily be downloaded through the command line with the stklos-pkg command. See the ScmPkg for more information.

Note:
The packages described below search the system GUI toolkit libraries in some standard places (mainly /usr/lib and /usr/local/lib). If your libraries are installed in another directory, you can set the shell variable STKLOS_GTK_DIR to that directory name. This variable is used both for installing the ScmPkg and for running your program.

Programming a GUI in STklos can be done at three different methods:

• The first method uses a simple wrapping of the GTK+ library. This wrapping is provided by the stklos-gtk-base package. Programming at this level is very similar to programming a GUI in C. In particular, standard GTK+ documentation can easily be followed to build a GUI. An example of GUI using this package is given below.

Code and explanations

• The second method uses the Glade interface builder. Glade home page describes it as “a RAD tool to enable quick & easy development of user interfaces for the GTK+ toolkit and the GNOME desktop environment, released under the GNU GPL License. The user interfaces designed in Glade are saved as XML, and by using the libglade library these can be loaded by applications dynamically as needed.”

To build an interface with the Glade interface builder, you need to install the stklos-gtk-glade package. An example of GUI using this package is given below.

Code and explanations

• The third method uses an OO model for GUI programming GUIs. This model is very similar to the one originally defined in STk Scheme. This model is described in the JFP and ISOTAS papers.

Programming interfaces with the OO model permits to define your own widgets thanks to the MOP of STklos. With the stklos-gtklos package you can define the following GUI:

Code and explanations