Mark Tarver <
[email protected]> wrote:
OK; a bit further on. I've not really looked at TLC/tk for a long time.
Basically I want TCL/tk to enter a loop and read a file. When the
file contains a TCL/tk command, This command should be read and
executed.
Are you looking for the existing [source] command?
It works fine for commands like 'bell' and 'puts' and fails for
widget commands. However when the event loop is existed, the missing
widgets appear.
This is normal. Most of the work of displaying widgets is performed on
the event loop as a background task. So if your Tcl code never returns
to the event loop, that work does not get performed.
Note that [bell] and [puts] are Tcl commands, not Tk commands, so they
do not interact with the event loop.
So there is some form of buffering going on.
Yes, much of the work is deferred to be run during "idle time" (time
when your Tcl script code is not running) of the GUI program.
If so, is there a way of flushing this buffer?
The [update] command is provided for just this purpose, but can have
other side effects (
https://wiki.tcl-lang.org/page/Update%20considered%20harmful).
I cite the program below.
Mark
set in {C:/Users/shend/OneDrive/Desktop/Shen/S37.2/shen-to-tcl.txt}
set out {C:/Users/shend/OneDrive/Desktop/Shen/S37.2/tcl-to-shen.txt}
proc eventloop {File} {
while { 1 } {
after 10
if { [newcommand? $File] } {
enact $File }
}}
Never returns, and contains no calls to [update] no the event loop
never gets to run, and all the deferred work is never performed.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)