Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Tutorial site: http://effbot.org/tkinterbook/tkinter-index.htm
- from tkinter import *
- def ButtonPress():
- print("Let's break it DOWN!")
- mainWindow = Tk()
- topFrame = Frame(mainWindow)
- topFrame.pack(side=TOP)
- bottomFrame = Frame(mainWindow)
- bottomFrame.pack(side=BOTTOM)
- myPhoto = PhotoImage(file="doge.gif")
- myPhotoLabel = Label(mainWindow, image=myPhoto)
- myPhotoLabel.photo = myPhoto
- myPhotoLabel.pack()
- myLabel = Label(topFrame, text="This is a label")
- myLabel.pack(side=TOP)
- myButton1 = Button(topFrame, text="Button 1", fg="red", command=ButtonPress)
- myButton2 = Button(topFrame, text="button 2", fg="blue", command=ButtonPress)
- myButton3 = Button(topFrame, text="Button 3", fg="green", command=ButtonPress)
- myButton4 = Button(bottomFrame, text="Button 4", fg="purple", command=ButtonPress)
- myButton1.pack(side=LEFT)
- myButton2.pack(side=LEFT)
- myButton3.pack(side=LEFT)
- myButton4.pack(side=RIGHT)
- mainWindow.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment