Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- from Tkinter import*
- from PIL import Image, ImageTk
- class Application(Frame):
- def __init__(self, master=None):
- Frame.__init__(self, master)
- self.grid()
- self.createWidgets()
- def exitapp(self, event):
- command=self.quit()
- def createWidgets(self):
- # pick an image file you have .bmp .jpg .gif. .png
- # load the file and covert it to a Tkinter image object
- self.imageFile = "message.png"
- self.image1 = ImageTk.PhotoImage(Image.open(self.imageFile))
- self.label1 = Label(text="Press Enter to Close This Window", padx=10, pady=5)
- self.label1.grid()
- self.label1 = Label(image=self.image1)
- self.label1.grid()
- self.okButton = Button (self, text="OK", command=self.quit)
- self.okButton.grid()
- self.okButton.focus()
- self.okButton.bind("<Return>", self.exitapp)
- app = Application()
- app.master.title("Part Notice")
- app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement