diff options
author | Guido van Rossum <guido@python.org> | 1991-08-16 13:22:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-08-16 13:22:53 (GMT) |
commit | 0d3f4678ba19b538f4e95994c58d18688a0f291b (patch) | |
tree | 87dfcd4147ed007bd490ff316cadecb62b10d3e2 /Lib/lib-stdwin/WindowSched.py | |
parent | e825f15900fb6eff920fe73aa141786052cf4070 (diff) | |
download | cpython-0d3f4678ba19b538f4e95994c58d18688a0f291b.zip cpython-0d3f4678ba19b538f4e95994c58d18688a0f291b.tar.gz cpython-0d3f4678ba19b538f4e95994c58d18688a0f291b.tar.bz2 |
Used mainloop instead of WindowParent functions
Diffstat (limited to 'Lib/lib-stdwin/WindowSched.py')
-rw-r--r-- | Lib/lib-stdwin/WindowSched.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/lib-stdwin/WindowSched.py b/Lib/lib-stdwin/WindowSched.py index 8c9151c..9125317 100644 --- a/Lib/lib-stdwin/WindowSched.py +++ b/Lib/lib-stdwin/WindowSched.py @@ -1,9 +1,9 @@ # Combine a real-time scheduling queue and stdwin event handling. # Uses the millisecond timer. -import stdwin +import stdwin, stdwinq from stdwinevents import WE_TIMER -import WindowParent +import mainloop import sched import time @@ -14,26 +14,26 @@ def delayfunc(msecs): # # Check for immediate stdwin event # - event = stdwin.pollevent() + event = stdwinq.pollevent() if event: - WindowParent.Dispatch(event) + mainloop.dispatch(event) return # # Use millisleep for very short delays or if there are no windows # - if msecs < 100 or WindowParent.CountWindows() = 0: + if msecs < 100 or mainloop.countwindows() = 0: if msecs > 0: time.millisleep(msecs) return # # Post a timer event on an arbitrary window and wait for it # - window = WindowParent.AnyWindow() + window = mainloop.anywindow() window.settimer(msecs/100) - event = stdwin.getevent() + event = stdwinq.getevent() window.settimer(0) if event[0] <> WE_TIMER: - WindowParent.Dispatch(event) + mainloop.dispatch(event) q = sched.scheduler().init(time.millitimer, delayfunc) @@ -46,13 +46,13 @@ cancel = q.cancel # Emptiness check must check both queues # def empty(): - return q.empty() and WindowParent.CountWindows() = 0 + return q.empty() and mainloop.countwindows() = 0 # Run until there is nothing left to do # def run(): while not empty(): if q.empty(): - WindowParent.Dispatch(stdwin.getevent()) + mainloop.dispatch(stdwinq.getevent()) else: q.run() |