for x in range(xBtns):
for y in range(yBtns):
btn = Button(board, width=2, height=1)
btn.grid(column=x, row=y)
btn.bind('<Button-3>', btnFunction)其中,btnFunction删除了右键单击的按钮。
发布于 2015-09-26 16:56:24
传递给绑定函数的event对象包含对接收事件的小部件的引用:
def btnFunction(event):
event.widget.destroy()发布于 2016-06-26 08:38:48
你可以这样做:
canvas.delete("all")当按钮被点击时。
https://stackoverflow.com/questions/32798628
复制相似问题