summaryrefslogtreecommitdiffstats
path: root/Lib/lib-tk/Tkinter.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2000-09-08 16:28:30 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2000-09-08 16:28:30 (GMT)
commit0d8ce6111c16c23c87afc2b06e60bb1b61f75746 (patch)
treef9df11b24027665e999f629020897d64ce4d7e94 /Lib/lib-tk/Tkinter.py
parent1a2eefdc4f92cfd4ddb50ac36bf8d0779e330123 (diff)
downloadcpython-0d8ce6111c16c23c87afc2b06e60bb1b61f75746.zip
cpython-0d8ce6111c16c23c87afc2b06e60bb1b61f75746.tar.gz
cpython-0d8ce6111c16c23c87afc2b06e60bb1b61f75746.tar.bz2
Fix for bug 110629: Generate unique image names by introducing a counter
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r--Lib/lib-tk/Tkinter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 3a1d7a4..31b072c 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -2910,6 +2910,7 @@ class OptionMenu(Menubutton):
class Image:
"""Base class for images."""
+ _last_id = 0
def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
self.name = None
if not master:
@@ -2918,7 +2919,8 @@ class Image:
raise RuntimeError, 'Too early to create image'
self.tk = master.tk
if not name:
- name = `id(self)`
+ Image._last_id += 1
+ name = "pyimage" +`Image._last_id` # tk itself would use image<x>
# The following is needed for systems where id(x)
# can return a negative number, such as Linux/m68k:
if name[0] == '-': name = '_' + name[1:]