diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-10-12 21:25:37 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-10-12 21:25:37 (GMT) |
commit | f2bd9ee357aad134fe4237c9668bcec7ae4d753b (patch) | |
tree | 1e5b25ddfc5c5ca8cecdbd27fd52420f4ed0380e /Mac/Lib | |
parent | 6433fdf1fe1e8b803bc785230e13c6959e2fdb1d (diff) | |
download | cpython-f2bd9ee357aad134fe4237c9668bcec7ae4d753b.zip cpython-f2bd9ee357aad134fe4237c9668bcec7ae4d753b.tar.gz cpython-f2bd9ee357aad134fe4237c9668bcec7ae4d753b.tar.bz2 |
Use MacOS.KeepConsole to always exit if the program calls FrameWork._quit(). Overridable with a class variable keepconsole.
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/FrameWork.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py index 320f141..50ffe5f 100644 --- a/Mac/Lib/FrameWork.py +++ b/Mac/Lib/FrameWork.py @@ -147,9 +147,15 @@ class Application: # (XXX I'm not sure if using default parameter values is the right # way to define the mask and wait time passed to WaitNextEvent.) + schedparams = (0, 0) # By default disable Python's event handling + + keepconsole = 0 # By default don't keep console window open + def mainloop(self, mask = everyEvent, wait = 0): self.quitting = 0 saveparams = apply(MacOS.SchedParams, self.schedparams) + if self.keepconsole != None: + MacOS.KeepConsole(self.keepconsole) try: while not self.quitting: try: @@ -162,8 +168,6 @@ class Application: finally: apply(MacOS.SchedParams, saveparams) - schedparams = (0, 0) # By default disable Python's event handling - def dopendingevents(self, mask = everyEvent): """dopendingevents - Handle all pending events""" while self.do1event(mask, wait=0): |