Untitled
public python v1 · immutableimport Tkinterclass C: def __init__(self, app): self.b = b = Tkinter.Button(app, command=self.command) b.bind("<ButtonPress>", self.pressed) b.bind("<ButtonRelease>", self.released) b.pack() def pressed(self, event): print "the button was pressed" def released(self, event): print "the button was released" def command(self): print "the button's command was invoked"app = Tkinter.Tk()c = C(app)app.mainloop()