diff options
author | Guido van Rossum <guido@python.org> | 1993-01-21 15:36:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-01-21 15:36:40 (GMT) |
commit | 80530ce8754956c8d5349d4644dc83113a63cfc1 (patch) | |
tree | a740c12cd745e7278fb0936ac420a436ae57cf7a /Lib/stdwin/mainloop.py | |
parent | 9672e44842c59e63920605a4c7ffab7345e73db4 (diff) | |
download | cpython-80530ce8754956c8d5349d4644dc83113a63cfc1.zip cpython-80530ce8754956c8d5349d4644dc83113a63cfc1.tar.gz cpython-80530ce8754956c8d5349d4644dc83113a63cfc1.tar.bz2 |
* Add some more tests for numbers
* mainloop.py: don't use select unless absolutely necessary (for Mac)
Diffstat (limited to 'Lib/stdwin/mainloop.py')
-rwxr-xr-x | Lib/stdwin/mainloop.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Lib/stdwin/mainloop.py b/Lib/stdwin/mainloop.py index 6b574cf..ca3e9ac 100755 --- a/Lib/stdwin/mainloop.py +++ b/Lib/stdwin/mainloop.py @@ -4,9 +4,6 @@ # - have a 'dispatch' function as a window member -# XXX This is UNIX specific! For the Mac we need to use a simpler version! - - import stdwin, stdwinq from stdwinevents import * @@ -132,9 +129,17 @@ def mainloop(): recursion_level = recursion_level + 1 try: stdwin_select_handler() # Process events already in queue - fd = stdwin.fileno() while 1: - if windows: + if windows and not fdlist: + while windows and not fdlist: + try: + event = stdwinq.getevent() + except KeyboardInterrupt: + event = (WE_COMMAND, \ + None, WC_CANCEL) + dispatch(event) + elif windows and fdlist: + fd = stdwin.fileno() if recursion_level == 1: registerfd(fd, 'r', stdwin_select_handler) try: |