HelloI tried various permutations of the code.Nothing worked. I am mixing 2 examples given in "an-introduction-to- tkinter " by Fredrik Lundh.(and got this code) Today I got this error message
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> pp() File "<pyshell#4>", line 18, in pp xx=app(root,event) NameError: global name 'event' is not defined Example1= # File: hello2.py from Tkinter import * class App: def __init__(self, master): frame = Frame(master) frame.pack() self.button = Button(frame, text="QUIT", fg="red", command=frame.quit) self.button.pack(side=LEFT) self.hi_there = Button(frame, text="Hello", command=self.say_hi) self.hi_there.pack(side=LEFT) def say_hi(self): print "hi there, everyone!" root = Tk() app = App(root) root.mainloop() Running the Example Example2= # File: bind1.py from Tkinter import * root = Tk() def callback(event): print "clicked at", event.x, event.y frame = Frame(root, width=100, height=100) frame.bind("<Button-1>", callback) frame.pack() root.mainloop() How can I mix the two? Prasad
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor