Improve Gambit REPL (toolbar is semi transparent and the alpha can be set with set...
[gambit-c.git] / examples / tcltk / fig16-6.scm
blob87e50c9e541a5e5a7b33bee93b55af229d8fe2c6
1 #!/usr/bin/env gsi-script
3 ; File: "fig16-6.scm"
5 ; Copyright (c) 1997-2007 by Marc Feeley, All Rights Reserved.
7 ; Translation into Scheme of Figure 16.6 from Chapter 16 of John
8 ; Ousterhout's "Tcl and the Tk Toolkit".
10 (include "tcltk#.scm") ; import Tcl/Tk procedures and variables
12 (load "tcltk")
14 (define (ok)     (display "ok")     (newline))
15 (define (appl)   (display "apply")  (newline))
16 (define (cancel) (display "cancel") (newline))
17 (define (help)   (display "help")   (newline))
19 (button ".ok"     text: "OK"     command: ok)
20 (button ".apply"  text: "Apply"  command: appl)
21 (button ".cancel" text: "Cancel" command: cancel)
22 (button ".help"   text: "Help"   command: help)
24 (pack ".ok" ".apply" ".cancel" ".help" side: 'left)
27 ; ==> Equivalent program in pure Tcl/Tk:
29 ; proc ok {}     { puts "ok" }
30 ; proc appl {}   { puts "apply" }
31 ; proc cancel {} { puts "cancel" }
32 ; proc help {}   { puts "help" }
34 ; button .ok     -text OK     -command ok
35 ; button .apply  -text Apply  -command appl
36 ; button .cancel -text Cancel -command cancel
37 ; button .help   -text Help   -command help
39 ; pack .ok .apply .cancel .help -side left