Add system exit action to a button : Event « GUI Tk « Python






Add system exit action to a button

Add system exit action to a button
 
from Tkinter import *
root = Tk()
Button(root, text='press', command=root.quit).pack(side=LEFT)
root.mainloop()


           
         
  








Related examples in the same category

1.Binding an event with an event handlerBinding an event with an event handler
2.Associating arguments to an event-handler functionAssociating arguments to an event-handler function
3.Sharing Information Between Event-Handler FunctionsSharing Information Between Event-Handler Functions
4.What Events Does 'Command' Bind To?What Events Does 'Command' Bind To?
5.adds callbacks function to a buttonadds callbacks function to a button
6.Update Label in action event
7.Class wrapper for GUI
8.Use lambda to generate a call back function for a buttonUse lambda to generate a call back function for a button