adds user-defined callbacks as button action : Button « GUI Tk « Python
- Python
- GUI Tk
- Button
adds user-defined callbacks as button action

from Tkinter import *
def quit():
print 'Hello...'
import sys; sys.exit()
widget = Button(None, text='Hello event world', command=quit)
widget.pack()
widget.mainloop()
Related examples in the same category