summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1997-05-27 22:45:10 (GMT)
committerFred Drake <fdrake@acm.org>1997-05-27 22:45:10 (GMT)
commitc8296db67df8955580be1fbb0ac5754b3c396107 (patch)
tree60594d8bc3d85c27c8abdb5ae6df0c7c43de23d7 /Lib
parentd812c07e0e64048275eb36c51754003405dbeaf7 (diff)
downloadcpython-c8296db67df8955580be1fbb0ac5754b3c396107.zip
cpython-c8296db67df8955580be1fbb0ac5754b3c396107.tar.gz
cpython-c8296db67df8955580be1fbb0ac5754b3c396107.tar.bz2
Widget._setup(): Support name=None in a similar way to the handling of other
Tkinter keyword parameters.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-tk/Tkinter.py3
-rwxr-xr-xLib/tkinter/Tkinter.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index d567467..9d5fa6f 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -890,10 +890,11 @@ class Widget(Misc, Pack, Place, Grid):
_default_root = master
self.master = master
self.tk = master.tk
+ name = None
if cnf.has_key('name'):
name = cnf['name']
del cnf['name']
- else:
+ if not name:
name = `id(self)`
self._name = name
if master._w=='.':
diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py
index d567467..9d5fa6f 100755
--- a/Lib/tkinter/Tkinter.py
+++ b/Lib/tkinter/Tkinter.py
@@ -890,10 +890,11 @@ class Widget(Misc, Pack, Place, Grid):
_default_root = master
self.master = master
self.tk = master.tk
+ name = None
if cnf.has_key('name'):
name = cnf['name']
del cnf['name']
- else:
+ if not name:
name = `id(self)`
self._name = name
if master._w=='.':