SHARE
TWEET

Untitled

a guest Nov 20th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from tkinter import *
  2.  
  3. texte = "gg"
  4.  
  5. def clic(event):
  6.     abs = event.x
  7.     ord = event.y
  8.     colonne = abs // 60 + 1
  9.     Can.delete(texte)
  10.     Can.create_text(550, 320, text ='Yo mec')
  11.    
  12. def deplacer(event):
  13.     global cercle
  14.     abs = event.x
  15.     ord = event.y
  16.     Can.coords(cercle, abs-20, ord-20, abs+20, ord+20)
  17.  
  18.  
  19. # La fenetre
  20. fen = Tk()
  21. fen.geometry('600x600+0+50')
  22. fen.title('YOOO')
  23. fen['bg'] = 'bisque'
  24.  
  25. Can = Canvas(fen, bg = 'white', width = 600, height = 600)
  26. cercle = Can.create_oval(320,320,280,280,fill="blue")
  27. Can.tag_bind(cercle, "<B1-Motion>", deplacer)
  28. Can.pack()
  29. Can.bind_all("<Button-1>", clic)
  30. x=60
  31. while x < 600:
  32.     Can.create_line(x,0,x,600)
  33.     x += 60
  34.  
  35.  
  36. fen.mainloop()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top