Next: , Previous: Obsolete Features, Up: Top


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 instance

     guile -s calc.scm

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.


calendar.scm
A tiny program showing the GtkCalendar widget.


clist.scm
Display the /etc/passwd file in a window. (You might need to enlarge the window manually.)


continuations.scm
Illustrate the use of Scheme continuations to resume application code when a dialog is answered, all the while running the usual Gtk main loop.


hello-world.scm
A simple program creating a button printing a familiar message.


metaspline.scm
A Metafont style bezier spline curve editor, using the Gdk drawing primitives.


simple.scm
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 instance
          guile -s run-glade.scm simple.glade


test-dnd.scm
test-gdk.scm
test-glade.scm
test-gtk.scm
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.


tictactoe.scm
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.