summaryrefslogtreecommitdiffstats
path: root/Lib/lib-stdwin
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib-stdwin')
-rw-r--r--Lib/lib-stdwin/mainloop.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Lib/lib-stdwin/mainloop.py b/Lib/lib-stdwin/mainloop.py
index 6b574cf..ca3e9ac 100644
--- a/Lib/lib-stdwin/mainloop.py
+++ b/Lib/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: