Hi,
I redirect stdout to a file. Then I use Tcl events to know when the file is readable and when it changes. Finally you just have to write a callback which will fill the text widget with the content of the file.
I don't know if it's the best way to do that, but it works.
PS: Don't forget to unbuffer stdout (cf expect)
Example:
#######
# Set up to deliver file events on the pipe
fconfigure $fd -buffering line -blocking false -translation auto
fileevent $fd readable [list callback $fd $widg]
# Launch the event loop and wait for the file events to # finish
vwait :

ONE
###
# And now the callback
####################
# fd is the file descriptor of the redirection of stdout
# Widg is the text widget
proc callback {fd widg} {
set status [catch {gets $fd line} result]
if { $status != 0 } {
# Error on the channel
$widg insert end "error reading $fd: $result"
set :

ONE 2
} elseif { $result >= 0 } {
# Successfully read the channel
$widg insert end "$line\n"
$widg see end
} elseif { [eof $fd] } {
# End of file on the channel
close $fd
set :

ONE 1
} elseif { [fblocked $fd] } {
# Read blocked. Just return
} else {
# Something else
tk_messageBox -title "Error" -message "can't happen!!!" -type "ok" -icon "error"
set :

ONE 3
}
}
I hope this will help!