diff options
author | Guido van Rossum <guido@python.org> | 1996-07-30 18:35:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1996-07-30 18:35:38 (GMT) |
commit | 053313a507f6cd94521739f679c7b8affb394f09 (patch) | |
tree | df825fe981de55603ba7ff15e667e17fd4a53566 /Lib/lib-tk/ScrolledText.py | |
parent | 8cf2db47ba8417d2ee8e105c47dc95a5a902a294 (diff) | |
download | cpython-053313a507f6cd94521739f679c7b8affb394f09.zip cpython-053313a507f6cd94521739f679c7b8affb394f09.tar.gz cpython-053313a507f6cd94521739f679c7b8affb394f09.tar.bz2 |
Change to use keyword args instead of dicts
Diffstat (limited to 'Lib/lib-tk/ScrolledText.py')
-rw-r--r-- | Lib/lib-tk/ScrolledText.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Lib/lib-tk/ScrolledText.py b/Lib/lib-tk/ScrolledText.py index 0261d90..cf6b2f1 100644 --- a/Lib/lib-tk/ScrolledText.py +++ b/Lib/lib-tk/ScrolledText.py @@ -14,22 +14,20 @@ from Tkinter import * from Tkinter import _cnfmerge class ScrolledText(Text): - def __init__(self, master=None, cnf={}): - cnf = _cnfmerge(cnf) + def __init__(self, master=None, **cnf): fcnf = {} - vcnf = {'name': 'vbar', - Pack: {'side': 'right', 'fill': 'y'},} for k in cnf.keys(): if type(k) == ClassType or k == 'name': fcnf[k] = cnf[k] del cnf[k] - self.frame = Frame(master, fcnf) - self.vbar = Scrollbar(self.frame, vcnf) - cnf[Pack] = {'side': 'left', 'fill': 'both', 'expand': 'yes'} + self.frame = apply(Frame, (master,), fcnf) + self.vbar = Scrollbar(self.frame, name='vbar') + self.vbar.pack(side=RIGHT, fill=Y) cnf['name'] = 'text' - Text.__init__(self, self.frame, cnf) - self['yscrollcommand'] = (self.vbar, 'set') - self.vbar['command'] = (self, 'yview') + apply(Text.__init__, (self, self.frame), cnf) + self.pack(side=LEFT, fill=BOTH, expand=1) + self['yscrollcommand'] = self.vbar.set + self.vbar['command'] = self.yview # Copy Pack methods of self.frame -- hack! for m in Pack.__dict__.keys(): |