16 Example Programs
The examples subdirectory in the sources contains various programs
illustrating Guile Gtk. Once Guile Gtk is installed each can be run with for
guile -s calc.scm
- A HP48 style desk calculator. It takes quite a bit of code to setup all the
widgets, but there's plenty of comments.
A .calcrc in the user's home directory can add new buttons. The
ability to load user extensions is a powerful feature and a significant
advantage Guile Gtk has over the regular C interface to Gtk.
- A tiny program showing the
- Display the /etc/passwd file in a window. (You might need to enlarge
the window manually.)
- Illustrate the use of Scheme continuations to resume application code when a
dialog is answered, all the while running the usual Gtk main loop.
- A simple program creating a button printing a familiar message.
- A Metafont style bezier spline curve editor, using the Gdk drawing primitives.
- A simple program with a label and a button.
- simple.glade, run-glade.scm
- A simple Glade application. Notice the use of
lambda forms in the
signal handlers. run-glade.scm loads and runs a glade application, for
guile -s run-glade.scm simple.glade
- Test programs for drag-and-drop, Gdk, Glade and Gtk respectively. These are
primarily for the developers' use, but can be run to see something happen and
to test Guile Gtk is working.
- Illustrate the use of
gtk-class-new to create a tic-tac-toe widget.
There's no actual “X” and “O” markers, only three squares in a row
recognised as a win.