mirror of
https://github.com/python/cpython.git
synced 2025-11-09 10:01:42 +00:00
Hide the ProgressBar before raising KeyboardInterrupt. Not doing so resulted in a hang on Carbon.
This commit is contained in:
parent
be1e569682
commit
5dd7362295
1 changed files with 8 additions and 2 deletions
|
|
@ -217,6 +217,8 @@ def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262
|
||||||
|
|
||||||
class ProgressBar:
|
class ProgressBar:
|
||||||
def __init__(self, title="Working...", maxval=100, label="", id=263):
|
def __init__(self, title="Working...", maxval=100, label="", id=263):
|
||||||
|
self.w = None
|
||||||
|
self.d = None
|
||||||
self.maxval = maxval
|
self.maxval = maxval
|
||||||
self.curval = -1
|
self.curval = -1
|
||||||
self.d = GetNewDialog(id, -1)
|
self.d = GetNewDialog(id, -1)
|
||||||
|
|
@ -229,8 +231,9 @@ def __init__(self, title="Working...", maxval=100, label="", id=263):
|
||||||
self.d.DrawDialog()
|
self.d.DrawDialog()
|
||||||
|
|
||||||
def __del__( self ):
|
def __del__( self ):
|
||||||
self.w.BringToFront()
|
if self.w:
|
||||||
self.w.HideWindow()
|
self.w.BringToFront()
|
||||||
|
self.w.HideWindow()
|
||||||
del self.w
|
del self.w
|
||||||
del self.d
|
del self.d
|
||||||
|
|
||||||
|
|
@ -268,6 +271,9 @@ def _update(self, value):
|
||||||
if Dlg.IsDialogEvent(ev):
|
if Dlg.IsDialogEvent(ev):
|
||||||
ds = Dlg.DialogSelect(ev)
|
ds = Dlg.DialogSelect(ev)
|
||||||
if ds[0] and ds[1] == self.d and ds[-1] == 1:
|
if ds[0] and ds[1] == self.d and ds[-1] == 1:
|
||||||
|
self.w.HideWindow()
|
||||||
|
self.w = None
|
||||||
|
self.d = None
|
||||||
raise KeyboardInterrupt, ev
|
raise KeyboardInterrupt, ev
|
||||||
else:
|
else:
|
||||||
if part == 4: # inDrag
|
if part == 4: # inDrag
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue