Add to Gambit REPL some functions to send SMS and take pictures (this functionnality...
[gambit-c.git] / examples / tcltk / fig16-11.scm
blob94109b95801d905607ea0f4d579f12a293a5546f
1 #!/usr/bin/env gsi-script
3 ; File: "fig16-11.scm"
5 ; Copyright (c) 1997-2007 by Marc Feeley, All Rights Reserved.
7 ; Translation into Scheme of Figure 16.11 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 (listbox ".words"
15          relief: 'raised
16          borderwidth: 2
17          yscrollcommand: ".scroll set")
19 (scrollbar ".scroll" command: ".words yview")
21 (pack ".words" side: 'left)
22 (pack ".scroll" side: 'right fill: 'y)
24 (for-each (lambda (word)
25             (tcl ".words" 'insert 'end word))
26           '("apple" "boat" "cherry" "donkey" "eagle" "feather" "gorilla"
27             "house" "indian" "jelly" "kayak" "letter" "man" "nun"
28             "ox" "puppy" "queen" "rabbit"))
31 ; ==> Equivalent program in pure Tcl/Tk:
33 ; listbox .words -relief raised -borderwidth 2 -yscrollcommand ".scroll set"
35 ; scrollbar .scroll -command ".words yview"
37 ; pack .words -side left
38 ; pack .scroll -side right -fill y
40 ; foreach word {apple boat cherry donkey eagle feather gorilla
41 ;               house indian jelly kayak letter man nun
42 ;               ox puppy queen rabbit} {
43 ;   .words insert end $word
44 ; }