First page Back Continue Last page Summary Graphic
comunicando com um pipe
proc rdmsg {} {
global mfile
if {[eof $mfile]} {
close $mfile
.t insert end "=== fim do pipe ==="
return
}
gets $mfile line
.t insert end $line\n
}
pack [text .t -width 60 -height 10] \
[button .b -text saida -command exit]
set mfile [open mypipe r]
fileevent $mfile readable rdmsg