【发布时间】:2014-06-21 23:44:02
【问题描述】:
我需要知道如何检测用鼠标拖动的椭圆是否进入另一个形状(矩形)。
class Bloque(): # Creates a block
def __init__(self, lista, ventana):
self.espacio = ventana # assings the canvas
box = self.espacio.create_rectangle(x1, y1, x2, y2, width = 0) # creates the block
self.espacio.tag_bind(box, '<Enter>', lambda e: print("Passed over"))
这会检测鼠标是否经过块,但是当我将其他形状拖到块上时,它没有被检测到。那么,当我将其他形状拖到块上时,我该如何做到这一点? 谢谢。
【问题讨论】:
标签: python class tkinter shape