« Programmation Python/Utilisation de fenêtres et de graphismes » : différence entre les versions
Contenu supprimé Contenu ajouté
Ligne 559 :
#!/usr/bin/python
#-*-coding:Utf-8-*-
from Tkinter import*
def avance(event):
can1.coords(oval,event.x-r,event.y-r,event.x+r,event.y+r)
x,y,r=10,10,10
def oval(x,y,r,coul):
can1.create_oval(x-r,y-r,x+r,y+r,outline=coul)
fen1=Tk()
fen1.title("Exercice d'animation avec Tkinter")
can1=Canvas(fen1,bg='dark grey',height=300,width=300)
oval=can1.create_oval(x,y,x+30,y+30,width=2,fill='red')
|