Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- texte = "gg"
- def clic(event):
- abs = event.x
- ord = event.y
- colonne = abs // 60 + 1
- Can.delete(texte)
- Can.create_text(550, 320, text ='Yo mec')
- def deplacer(event):
- global cercle
- abs = event.x
- ord = event.y
- Can.coords(cercle, abs-20, ord-20, abs+20, ord+20)
- # La fenetre
- fen = Tk()
- fen.geometry('600x600+0+50')
- fen.title('YOOO')
- fen['bg'] = 'bisque'
- Can = Canvas(fen, bg = 'white', width = 600, height = 600)
- cercle = Can.create_oval(320,320,280,280,fill="blue")
- Can.tag_bind(cercle, "<B1-Motion>", deplacer)
- Can.pack()
- Can.bind_all("<Button-1>", clic)
- x=60
- while x < 600:
- Can.create_line(x,0,x,600)
- x += 60
- fen.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement