* Luc <
[email protected]>
| This Tk application uses a while infinite loop. Upon each iteration,
| it checks a boolean variable that I can toggle with a key binding.
| If the value is 0, the loop continues but does nothing because of
| the first line:
| if {$::GO == 0} {continue}
| The activity stops as expected, but then it becomes unresponsive.
| I can't untoggle, I can't do anything.
That's because mouse clicks are handled by the event loop.
Losely spoken, the event loop runs only if there is nothing else to do,
and cleary the above tight loop is "something" to do ;-)
| What is the correct way of doing what I want?
Check 'vwait' or 'tkwait variable' if you want to wait for a variable to
be set while the GUI stays responsive:
https://www.tcl.tk/man/tcl/TclCmd/vwait.html
https://www.tcl.tk/man/tcl/TkCmd/tkwait.html
or 'update' if you need to give the GUI a go during a runnning calculation
https://www.tcl.tk/man/tcl/TclCmd/update.html
(but be aware of
https://wiki.tcl-lang.org/page/Update+considered+harmful
)
HTH
R'
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)