[ python-Bugs-1160383 ] digit-only tag values are mishandled in Tkinter

SourceForge.net noreply at sourceforge.net
Sat Mar 19 17:53:44 CET 2005


Bugs item #1160383, was opened at 2005-03-10 05:32
Message generated for change (Comment added) made by effbot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1160383&group_id=5470

Category: Tkinter
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ilya Sandler (isandler)
Assigned to: Martin v. Löwis (loewis)
Summary: digit-only tag values are mishandled in Tkinter

Initial Comment:
It  appears that  most Tkinter tag operations fail on
digit-only tag values

>>> from Tkinter import *
>>> root=Tk()
>>> c=Canvas(root)
>>> c.create_line(0,0,100,100, tags="123")
1
>>> c.gettags(1)
('123',)
>>> c.pack()       
>>> c.find_withtag("123")
()

tkinter docs:
http://www.pythonware.com/library/tkinter/introduction/x2017-concepts.htm

only say this about tag values:
  "Tags are ordinary strings, and they can contain
anything except whitespace."

So this behaviour seems like a bug.

----------------------------------------------------------------------

>Comment By: Fredrik Lundh (effbot)
Date: 2005-03-19 17:53

Message:
Logged In: YES 
user_id=38376

Here's the text before the quoted line:

"Everywhere a method expects an item specifier, you can 
use one of the following: * item handles * tags /.../ Item 
handles are integer values that are used to identify a specific 
item on the canvas /.../ Item handles can be passed to the 
various canvas methods either as integers or as strings. /.../"

Note the use of "one of", and the fact that item handles are 
described before tags. (Writing documentation for people who 
only reads random sentences is pretty much impossible...)

----------------------------------------------------------------------

Comment By: Jeff Epler (jepler)
Date: 2005-03-19 15:20

Message:
Logged In: YES 
user_id=2772

This is a documentation bug.  The Tk documentation says
(canvas, section "ITEM IDS AND TAGS"):
       Each  item may also have any number of tags
associated with it.  A tag
       is just a string of characters, and it may take any
form  except  that
       of  an  integer.   For example, ‘‘x123’’ is OK but
‘‘123’’ isn’t.  The
       same tag may be associated with many different items.

Furthermore, the site www.pythonware.com is a third-party
site not run by the Python developers.  The official Python
documentation
(http://docs.python.org/lib/module-Tkinter.html and 'pydoc
Tkinter') doesn't explain the syntax of an item tag anywhere
that I could see)

I recommend closing this bug and notifying pythonware.com /
Fredrik Lundh about the problem via e-mail.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1160383&group_id=5470


More information about the Python-bugs-list mailing list