Hi all. I have a very simple app, but I don't know how to get position of the circles. Here's the code:
from Tkinter import * master = Tk() global w def dotToDot1(event): global w circles = 0 x = event.x y = event.y c1 = w.create_oval(x, y, x+10, y+10) c2 = w.create_oval(x, y, x+10, y+10) l = w.create_line(c1.x, c1.y, c2.x, c2.y) w = Canvas(master, width=200, height=100) w.bind("<Button->", dotToDot1) w.pack() mainloop()
How do I get c1 x, y and c2 x, y?
It always says:
'int' object has no attribute 'x'