set ::stop 0
pack [button .s -text Break! -command { set ::stop 1 }]
while 1 {
# this is an endless loop
if {$::stop} { break }
update
}
.s config -text stopped
The 'update' permits the button to gain control and stop the endless loop thru a global control variable.
For that, you need to use wish.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.