Bind ESC to close-window.

This commit is contained in:
Guido van Rossum 1999-01-11 14:46:55 +00:00
parent dc5066ee81
commit 9016fcf41c
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ def __init__(self, pyshell):
self.pyshell = pyshell
self.make_gui()
def close(self):
def close(self, event=None):
if self.interacting:
self.top.bell()
return
@ -51,6 +51,7 @@ def make_gui(self):
self.top.wm_title("Debug Control")
self.top.wm_iconname("Debug")
top.wm_protocol("WM_DELETE_WINDOW", self.close)
self.top.bind("<Escape>", self.close)
#
self.bframe = bframe = Frame(top)
self.bframe.pack(anchor="w")