from Tkinter import * class Keys(Frame): def __init__(self): Frame.__init__(self) self.txtBox=Text(self) #When typing 'quit', the program will exit. self.txtBox.bind('quit',self.QuitEvent) #The pack() determines the place. self.txtBox.pack() self.pack() def QuitEvent(self,event): import sys sys.exit() |
---|
myApp = Keys() myApp.mainloop() |
---|