if 0 {
Richard Suchenwirth 2003-03-12 - Here's a cute little application for the
iPAQ: a signal light. Dirt simple: fill the display in a single color, controlled by the "cursor keys" (navigation button up/down/left/right, back to white when hit a second time). But when background lighting is on, you can use this for signalling in the dark - or, with the default white, as a mild pocket lamp... or to test whether the display's pixels are all working... Yellow looks pretty beige, though. A cheap thrill at less than 900 bytes, this documentation included ;-) }
proc sigbind {w color} {
if {[$w cget -background] == $color} {set color white}
$w config -background $color
}
pack [canvas .c -background white -height 320]
wm geometry . +0+0
wm title . "Signal lamp: use cursor-keys to change color"
foreach {key color} {Up red Down green Left yellow Right blue} {
bind . <$key> "sigbind .c $color"
}
if 0 {
Arts and crafts of Tcl-Tk programming }