>Hello,
>
>I am trying to use Vtcl to produce an X front end for
>a commandline program written in C.  All it has to do
>is exec the program when it is run display all output
>onto a text widget and then kill the app when the
>exit button is pressed.
>
>I am using the below code to execute and capture the
>stdio output which works well, except that you cannot
>use the exit button while it is running.  What I need
>to know is if there is an equivalent function similar
>to Visual Basic's DoEvents()?  ie, allow the script to
>multitask properly, or is there another approach to
>this?
>
>.top26.tex30 delete 1.0 end
>
>set exec [ open |$script r ]
>while { [gets $exec data] >= 0} {
>    update
>    .top26.tex30 insert end "$data\n"
>    update
>}
>close $exec
>
>Regards Sean.


Hello,

You might want to take a look at Brent Welch's "execLog", Chapter 19.
http://www.beedub.com/book/2nd/TKEXAMPL.doc.html#155

It is non-portable since it uses 'cat' but that doesn't sound like that
would be an issue with you.  And as Martin pointed out, you probably want
to configure
the input stream to non-blocking mode.

Mitch.


---------------------------------------------------------------------------
To unsubscribe from the Visual Tcl mailing list, please send a message
to [EMAIL PROTECTED] with "unsubscribe vtcl [EMAIL PROTECTED]" in the
message body (where [EMAIL PROTECTED] is your e-mail address).

Reply via email to