1 #!/usr/bin/env gsi-script
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
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