Canvas Object Tags: Help for Rookie

Fredrik Lundh fredrik at pythonware.com
Wed Dec 18 18:07:34 EST 2002


"John Smith" <someone at microsoft.com> wrote:

> I am goofing around with the canvas class and trying to reference line
> objects drawn on a canvas by their tags.  I thought the easiest appraoch
> would be to give each new line an tag set by an integer counter.

tags must start with a letter; if they look like integers, they're
interpreted as item handles.

more here:

    http://effbot.org/books/tkinterbook/canvas.htm

:::

as for the attribute error, your code snippet doesn't show how or
where you're setting the "canvas" attribute, or what you're setting
it to.  Python usually tells you what attribute it expected; if it com-
plains about a missing "canvas", make sure it's set.  if it complains
about a missing "coords", make sure you set it to a canvas widget.
if you cannot sort it out yourself, post more code, and include the
full traceback.

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->






More information about the Python-list mailing list