Hello Everyone,
I am new to python and I am trying to get a program
to close a application when the Escape Key is pressed.
This is the code that I used
---------------------------------
from Tkinter import *
class Application(Fra me):
def createWidgets(s elf):
self.lab = Label(text="Hel lo World")
self.lab.pack()
def __init__(self, master=None):
Frame.__init__( self, master)
self.pack()
self.createWidg ets()
self.bind('<Key-Escape>',self.q uit)
app = Application()
app.mainloop()
---------------------------------
It is displaying everything properly, but it is not quiting
when the escape key is pressed.
What am I doing wrong
Thank You,
Binny V A
I am new to python and I am trying to get a program
to close a application when the Escape Key is pressed.
This is the code that I used
---------------------------------
from Tkinter import *
class Application(Fra me):
def createWidgets(s elf):
self.lab = Label(text="Hel lo World")
self.lab.pack()
def __init__(self, master=None):
Frame.__init__( self, master)
self.pack()
self.createWidg ets()
self.bind('<Key-Escape>',self.q uit)
app = Application()
app.mainloop()
---------------------------------
It is displaying everything properly, but it is not quiting
when the escape key is pressed.
What am I doing wrong
Thank You,
Binny V A
Comment