I have a question from VPython thread example.
Tk-Visual.py example has two threads, one for Tk even thread and the other
one for visual animation thread.
At first, the visual animation thread starts by setting its flag,
ProgClass.run, to "run". Then Tk event thread starts by "tkr.mainloop()".
What I cannot understand comes now. Right after starting the Tk event
thread, the run flag of ProgClass set to "stop".
I think it should result in stopping the visual thread, box_anim() method
because the condition of while loop couldn't be satisfied. Upon exiting the
visual thread, box_anim(), the run flag of ProgClass set to "stopped". I
thought the visual animation should stop now because the run flag is no
longer "run". But the visual thread kept going even though I couldn't find
any source where the run flag of ProgClass set back to "run".
Can anybody explain how this works?
Thanks in advance.
YJ
|