【发布时间】:2018-10-26 15:49:29
【问题描述】:
canvas=Canvas(...)
unique_id=canvas.create_rectangle(...)
unique_id.tag_bind(...)
我收到这个错误是因为它是一个整数
AttributeError: 'int' object has no attribute 'tag_bind'
我需要得到对象
【问题讨论】:
-
画布项目实际上不是对象;整数ID就是你得到的全部。您可以通过调用 Canvas 本身的方法来处理它们,将这些 ID 作为参数传递。
-
谢谢。我应该如何为这个特定的矩形调用 tag_bind?
标签: python tkinter tkinter-canvas tkinter-layout