HelloI changed the code as follows.But still the callback function is not
working.
The he() is working well but clicking on the frame has no result.
class app:
def __init__(self,root):
frame=Frame(root)
frame.bind("<Button-1>", callback)
frame.pack()
self.button=Button(root,text='quit',fg='red',command=frame.quit)
self.button.pack(side='left')
self.hi=Button(root,text='hi',fg='SystemWindowFrame',command=self.hi)
self.hi.pack(side='right')
self.callback
def hi (self): print 'hello! there'
def callback(self,event):
print "clicked at", event.x, event.y
>>> root=Tk()
>>> xx=app(root)
>>> root.mainloop()
hello! there
hello! there
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor