B
Binny V A
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(Frame):
def createWidgets(self):
self.lab = Label(text="Hello World")
self.lab.pack()
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
self.bind('<Key-Escape>',self.quit)
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
http://www.geocities.com/binnyva/code
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(Frame):
def createWidgets(self):
self.lab = Label(text="Hello World")
self.lab.pack()
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
self.bind('<Key-Escape>',self.quit)
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
http://www.geocities.com/binnyva/code