Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2012
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. from Tkinter import*
  4. from PIL import Image, ImageTk
  5.  
  6. class Application(Frame):
  7. def __init__(self, master=None):
  8. Frame.__init__(self, master)
  9. self.grid()
  10. self.createWidgets()
  11.  
  12. def exitapp(self, event):
  13. command=self.quit()
  14.  
  15. def createWidgets(self):
  16. # pick an image file you have .bmp .jpg .gif. .png
  17. # load the file and covert it to a Tkinter image object
  18. self.imageFile = "message.png"
  19. self.image1 = ImageTk.PhotoImage(Image.open(self.imageFile))
  20.  
  21. self.label1 = Label(text="Press Enter to Close This Window", padx=10, pady=5)
  22. self.label1.grid()
  23.  
  24. self.label1 = Label(image=self.image1)
  25. self.label1.grid()
  26.  
  27. self.okButton = Button (self, text="OK", command=self.quit)
  28. self.okButton.grid()
  29. self.okButton.focus()
  30. self.okButton.bind("<Return>", self.exitapp)
  31.  
  32.  
  33.  
  34. app = Application()
  35. app.master.title("Part Notice")
  36. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement