tkinter GUI full
Tk button with onClick event To create a Tkinter window with a button use the example below. The program enters mainloop() which wait for events (user actions). We define the button which has a callback to the function callback(). master is the root window, the window where your button will appear in. from Tkinter import * master = Tk ( ) def callback ( ) : print "click!" b = Button ( master , text = "OK" , command = callback ) b. pack ( ) mainloop ( ) tk button Tk image button If you want an image button, use the PhotoImage class. We set the size of the window and the miminum size with the functions minsize() and geometry(). Example: from Tkinter import * master = Tk ( ) master. minsize ( 300 , 100 ) master. geometry ( "320x100" ) def callback ( ) : print "click!" photo = PhotoImage ( file = "add.png" ) b = Button ( master , image = photo , command = callback , he...