diff options
author | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1998-10-13 16:32:29 (GMT) |
commit | ae08d3897ab467f656653ea1062f6fc54fed32e6 (patch) | |
tree | db9a6b3cfe10290f76f7031bca6a44588a29c338 /Tools | |
parent | 1956352b08c219f37ab639f875fcc360ff123f99 (diff) | |
download | cpython-ae08d3897ab467f656653ea1062f6fc54fed32e6.zip cpython-ae08d3897ab467f656653ea1062f6fc54fed32e6.tar.gz cpython-ae08d3897ab467f656653ea1062f6fc54fed32e6.tar.bz2 |
Add a close() method and bind to WM_DELETE_WINDOW protocol
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/idle/StackViewer.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tools/idle/StackViewer.py b/Tools/idle/StackViewer.py index dbfc4b0..52169a5 100644 --- a/Tools/idle/StackViewer.py +++ b/Tools/idle/StackViewer.py @@ -18,6 +18,7 @@ class StackViewer: root = top = Tk() else: top = Toplevel(root) + self.top.protocol("WM_DELETE_WINDOW", self.close) self.root = root self.top = top top.wm_title("Stack viewer") @@ -51,6 +52,9 @@ class StackViewer: stack = getstack() self.load_stack(stack) self.statuslabel.config(text=getexception()) + + def close(self): + self.top.destroy() def load_stack(self, stack): self.stack = stack |