diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-23 22:18:27 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-23 22:18:27 (GMT) |
commit | 5dd7362295c71427f80d0bf404bf122cdd013b3c (patch) | |
tree | e6219eb7e260a779d3fa1167fd590e3218d4e906 /Mac/Lib | |
parent | be1e569682fcc455f792d62e23694c7bb756e15e (diff) | |
download | cpython-5dd7362295c71427f80d0bf404bf122cdd013b3c.zip cpython-5dd7362295c71427f80d0bf404bf122cdd013b3c.tar.gz cpython-5dd7362295c71427f80d0bf404bf122cdd013b3c.tar.bz2 |
Hide the ProgressBar before raising KeyboardInterrupt. Not doing so resulted in a hang on Carbon.
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/EasyDialogs.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Mac/Lib/EasyDialogs.py b/Mac/Lib/EasyDialogs.py index 3f88fb5..a486204 100644 --- a/Mac/Lib/EasyDialogs.py +++ b/Mac/Lib/EasyDialogs.py @@ -217,6 +217,8 @@ screenbounds = screenbounds[0]+4, screenbounds[1]+4, \ class ProgressBar: def __init__(self, title="Working...", maxval=100, label="", id=263): + self.w = None + self.d = None self.maxval = maxval self.curval = -1 self.d = GetNewDialog(id, -1) @@ -229,8 +231,9 @@ class ProgressBar: self.d.DrawDialog() def __del__( self ): - self.w.BringToFront() - self.w.HideWindow() + if self.w: + self.w.BringToFront() + self.w.HideWindow() del self.w del self.d @@ -268,6 +271,9 @@ class ProgressBar: if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: + self.w.HideWindow() + self.w = None + self.d = None raise KeyboardInterrupt, ev else: if part == 4: # inDrag |