MCPcopy Create free account
hub / github.com/ActiveState/code / mainloop

Function mainloop

recipes/Python/578153_safetkinterpy/recipe-578153.py:25–33  ·  view source on GitHub ↗

Creates a synthetic main loop so that threads can still run.

(self)

Source from the content-addressed store, hash-verified

23
24@threadbox.MetaBox.thread
25def mainloop(self):
26 "Creates a synthetic main loop so that threads can still run."
27 while True:
28 try:
29 self.update()
30 except tkinter.TclError:
31 break
32 else:
33 time.sleep(tkinter._tkinter.getbusywaitinterval() / 1000)
34
35threadbox.MetaBox.clone(tkinter.Misc, {'mainloop': mainloop})
36

Callers 13

recipe-579048.pyFile · 0.90
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50
recipe-227575.pyFile · 0.50
mainFunction · 0.50
mainFunction · 0.50
recipe-574436.pyFile · 0.50
recipe-574437.pyFile · 0.50

Calls 2

updateMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected