summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-07-21 03:05:05 (GMT)
committerGuido van Rossum <guido@python.org>1996-07-21 03:05:05 (GMT)
commitad8b3baa919f5ab1201fca0e608905851f24e967 (patch)
tree36258e86326cf7f7aec1d52c93bec59d4b7b096e /Lib
parent81652ab67a404639a29c1239da1a6439eeffbda4 (diff)
downloadcpython-ad8b3baa919f5ab1201fca0e608905851f24e967.zip
cpython-ad8b3baa919f5ab1201fca0e608905851f24e967.tar.gz
cpython-ad8b3baa919f5ab1201fca0e608905851f24e967.tar.bz2
Restore the capability to pass a class (usually Pack) as an option to widget
creation; no longer support this for the config method.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-tk/Tkinter.py11
-rwxr-xr-xLib/tkinter/Tkinter.py11
2 files changed, 14 insertions, 8 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 4c7fd71..ac814a9 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -827,8 +827,15 @@ class Widget(Misc, Pack, Place, Grid):
cnf = _cnfmerge((cnf, kw))
self.widgetName = widgetName
Widget._setup(self, master, cnf)
+ classes = []
+ for k in cnf.keys():
+ if type(k) is ClassType:
+ classes.append((k, cnf[k]))
+ del cnf[k]
apply(self.tk.call,
(widgetName, self._w) + extra + self._options(cnf))
+ for k, v in classes:
+ k.config(self, v)
def config(self, cnf=None, **kw):
# XXX ought to generalize this so tag_config etc. can use it
if kw:
@@ -845,10 +852,6 @@ class Widget(Misc, Pack, Place, Grid):
x = self.tk.split(self.tk.call(
self._w, 'configure', '-'+cnf))
return (x[0][1:],) + x[1:]
- for k in cnf.keys():
- if type(k) is ClassType:
- k.config(self, cnf[k])
- del cnf[k]
apply(self.tk.call, (self._w, 'configure')
+ self._options(cnf))
configure = config
diff --git a/Lib/tkinter/Tkinter.py b/Lib/tkinter/Tkinter.py
index 4c7fd71..ac814a9 100755
--- a/Lib/tkinter/Tkinter.py
+++ b/Lib/tkinter/Tkinter.py
@@ -827,8 +827,15 @@ class Widget(Misc, Pack, Place, Grid):
cnf = _cnfmerge((cnf, kw))
self.widgetName = widgetName
Widget._setup(self, master, cnf)
+ classes = []
+ for k in cnf.keys():
+ if type(k) is ClassType:
+ classes.append((k, cnf[k]))
+ del cnf[k]
apply(self.tk.call,
(widgetName, self._w) + extra + self._options(cnf))
+ for k, v in classes:
+ k.config(self, v)
def config(self, cnf=None, **kw):
# XXX ought to generalize this so tag_config etc. can use it
if kw:
@@ -845,10 +852,6 @@ class Widget(Misc, Pack, Place, Grid):
x = self.tk.split(self.tk.call(
self._w, 'configure', '-'+cnf))
return (x[0][1:],) + x[1:]
- for k in cnf.keys():
- if type(k) is ClassType:
- k.config(self, cnf[k])
- del cnf[k]
apply(self.tk.call, (self._w, 'configure')
+ self._options(cnf))
configure = config