from tkinter import * import _thread, time def hiirevajutus(event): global x, y, d, dx, dy, ddy dx=event.x-x dy=event.y-y ddy=0.1 def liigu(): global x, y, d, dx, dy, ddy while y<200: x=x+dx y=y+dy ala.coords(ovaal, x, y, x+d, y+d) time.sleep(0.1) dy=dy+ddy aken=Tk() ala=Canvas(aken, width=400, height=300, bg='white') ala.pack() x=10 y=100 d=15 dx=0 dy=0 ddy=0 ovaal=ala.create_oval(x, y, x+d, y+d, fill="blue") _thread.start_new_thread(liigu, ()) ala.bind("", hiirevajutus) aken.mainloop()