commit
This commit is contained in:
commit
8a24549cdb
21 changed files with 3478 additions and 0 deletions
13
StartingPoint/lib/realtime/tk_event_loop.py
Normal file
13
StartingPoint/lib/realtime/tk_event_loop.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
from lib.realtime.event_loop import AbstractEventLoop
|
||||
|
||||
# schedules calls in an existing tkinter eventloop
|
||||
class TkEventLoopAdapter(AbstractEventLoop):
|
||||
def __init__(self, tk):
|
||||
self.tk = tk
|
||||
|
||||
def schedule(self, delay, callback):
|
||||
return self.tk.after(int(delay / 1000000), # ns to ms
|
||||
callback)
|
||||
|
||||
def cancel(self, timer):
|
||||
self.tk.after_cancel(timer)
|
||||
Loading…
Add table
Add a link
Reference in a new issue