Acquaintance GUI programming 01

# Coding = UTF-8 
# create the main window object
from Tkinter Import *
from Tkinter Import MessageBox
root = Tk () # create a window

btn01 = Button (root) # The button is set to the window
btn01 [ "text"] = "Point me on flowers "
btn01.pack ()

DEF Songhua (E): # E is the event object
messagebox.showinfo (" Message "," give you a little flower ")

# event binding
btn01.bind (" <Button-1 > ", songHua) # left click

root.mainloop () # call to the component mainloop () method, enter the event loop monitor user actions

Guess you like

Origin www.cnblogs.com/walxt/p/11504529.html