gorskaja2019

Untitled

Apr 3rd, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root = Tk()
  4.  
  5. def on_click(event):
  6. t = event.widget
  7. t['image'] = ''
  8.  
  9. fox = PhotoImage(file = 'test.gif')
  10. button = Button(image = fox)
  11. button.pack()
  12. button.bind('<Button-1>', on_click)
  13.  
  14. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment