Re: Using a tk text widget for stdout
- From: "slebetman@xxxxxxxxx" <slebetman@xxxxxxxxx>
- Date: 9 Mar 2006 23:28:31 -0800
WillemF wrote:
I am using a text widget as a substitute for the stdout of binary
executables in Linux.
e.g: if t is the tk text widget:
$t insert end [exec ./dnaml < dnaml.setup]
However, the whole output of dnaml to stdout is only appended within
the widget after dnaml has completed execution. While dnaml is
executing, no output appears in the widget. I need to see the output as
it is produced, more or less as it would appear in a terminal window.
Id there any way around this problem? Is the text widget perhaps
inappropriate? I would greatly appreciate any advice.
In Linux no problem. Just do:
proc getResult {channel} {
.t insert end [read $channel]
}
set f [open | ./dnaml < dnaml.setup]
fconfigure $f -blocking 0
fileevent $f readable "getResult $f"
This code doesn't work in Windows though, you'll get the output only
after a program terminates just like what you're getting now.
.
- Follow-Ups:
- Re: Using a tk text widget for stdout
- From: WillemF
- Re: Using a tk text widget for stdout
- From: Arjen Markus
- Re: Using a tk text widget for stdout
- References:
- Using a tk text widget for stdout
- From: WillemF
- Using a tk text widget for stdout
- Prev by Date: Re: TCLSOAP & XML namespaces
- Next by Date: Re: Status of Tip 257?
- Previous by thread: Using a tk text widget for stdout
- Next by thread: Re: Using a tk text widget for stdout
- Index(es):
Relevant Pages
|
Loading