![](/img/trans.png)
[英]How can I get the object id of a tkinter canvas item built by a self-defined class?
[英]How can I get object from its unique id in Tkinter?
canvas=Canvas(...)
unique_id=canvas.create_rectangle(...)
unique_id.tag_bind(...)
我收到此錯誤,因為它是整數
AttributeError: 'int' object has no attribute 'tag_bind'
我需要拿東西
您需要將以下tag_bind與畫布項目一起使用。
canvas=Canvas(...)
unique_id=canvas.create_rectangle(...)
canvas.tag_bind(unique_id,...)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.