我正在编写程序,我正在尝试将find_overlap与函数坐标一起使用。这是代码
from tkinter import *
root = Tk()
coords = 1082, 473
canvas = Canvas(root, width=1080, height=960)
frame = Frame(root, width=209, height=960)
def cords(event):
print(event.x, event.y)
def click(event):
canvas_id = canvas.create_line(event.x, event.y, coords)
canvas.after(100,canvas.delete,canvas_id)
line = click
canvas.bind('<Button-1>',line)
obj1=canvas.create_line(247,157,605,482)
obj2=canvas.create_line(802,720,270,640)
canvas.find_overlapping(247,157,)
photo = PhotoImage(file='76.gif')
label = Label(frame, image=photo)
label.config(image=photo)
label.pack()
frame.pack(side='right')
canvas.pack(side='left')
root.mainloop()
我只需要知道如何使用click_overlap函数和click函数。
答案 0 :(得分:0)
你给它一个矩形的坐标,它找到任何重叠的东西