-#!/usr/bin/wish
+#!/usr/bin/wish8.2
proc widgets {} {
global widg_pipe
#puts stderr "update_seg $segname"
if {!$power} {
- setsegbyname $segname off
- return
+ set command off
} else {
set command [expr {$d ? "det" : "on"}]
if {$r} { set command "i$command" }
foreach mov $movs {
#puts stderr "update_seg $segname mov $mov"
upvar #0 movpos($mov) mp
- if {[string length $mp]} {
+ if {[string length $mp] && [string compare off $command]} {
setsegbyname $mov $command $mp
} else {
setsegbyname $mov $command
update_push
}
+proc EOE {} { global exitoneof; set exitoneof 1}
+
main
-while {[gets stdin l]} {
+while {[gets stdin l]>=0} {
if {[regexp {^GUI ([A-Z][0-9a-zA-Z ]*)$} $l dummy cmd]} {
- puts " * $cmd"
+ puts "GUI $cmd"
eval $cmd
} else {
puts $l
}
}
+
+if {[info exists exitoneof]} { exit 0 }