问题
From reading the docs (http://effbot.org/tkinterbook/canvas.htm#reference), there doesn't appear to me to be a way to do this. Just wanted to make sure I hadn't made a mistake. (I.e. one would have to internally store the coordinates of various items in a program if one wanted to do boundary checking, for example. [e.g. Check, before moving an oval, that it will not bump into a wall, represented by a line on the current canvas, the coordinate information of which is also stored.])
回答1:
Use the coords method:
coords = the_canvas.coords(item_id)
来源:https://stackoverflow.com/questions/28389728/get-the-current-coordinates-of-an-item-on-a-canvas-widget-given-its-item-handle