]> granicus.if.org Git - python/commitdiff
Fix for bug 110629: Generate unique image names by introducing a counter
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 8 Sep 2000 16:28:30 +0000 (16:28 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 8 Sep 2000 16:28:30 +0000 (16:28 +0000)
Lib/lib-tk/Tkinter.py

index 3a1d7a4eae3804c36556e9f7b86f1f3d8585603e..31b072cb4cb3c9bf3a1b64550bddeb6e1b511738 100644 (file)
@@ -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:]