我如何识别鼠标点击附近的标签。这里我的定义“识别”应该识别非常接近鼠标点击的标签。
from Tkinter import *
root = Tk()
f=Frame(root)
f.grid()
w=Canvas(f)
line1=w.create_line(50,50,150,150, width=5, tags="line1")
line2=w.create_line(100,100,100,350, width=3, tags="line2")
line3=w.create_line(150,150,150,450, width=3, tags="lines")
w.grid(row=0, column=0)
w.bind("<Button-1>", identify)
def identify(event): ## this should identify the tag near to click
u=Frame(f)
u.grid(row=0, column=1)
root.mainloop()
谢谢