Guest User

Untitled

a guest
Jun 24th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. def showpopup(self, event, item):
  2. global r
  3.  
  4. if str(event.type) == "Enter":
  5. r = tk.Tk()
  6. r.geometry("400x900+{:}+{:}".format(self.winfo_rootx()+840, self.winfo_rooty()))
  7. r.wm_title("Pop UP")
  8. r.overrideredirect(True)
  9. im = Image.open(os.path.join(images_db_dir, "a.png"))
  10. imaitem = ImageTk.PhotoImage(im)
  11. r.columnconfigure(0, weight=1)
  12. r.rowconfigure(0, weight=1)
  13.  
  14. mf = tk.Frame(r)
  15. mf.grid(row = 0, column=0, sticky="nsew")
  16.  
  17. mf.grid_columnconfigure(0, weight=1)
  18. f1, f2 = tk.Frame(mf, , tk.Frame(mf, background="red")
  19. f1.place(x=5, y=5, anchor="nw", width=390, height=390)
  20. f2.place(x=0, y=405, anchor="nw", width=400, height=400)
  21.  
  22. l = tk.Label(f1, image = imaitem)
  23. l.image = imaitem
  24. l.grid()
  25. r.mainloop()
  26.  
  27. elif str(event.type) == "Leave":
  28. r.destroy()
Add Comment
Please, Sign In to add comment