diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-25 13:52:13 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-09-25 13:52:13 (GMT) |
commit | 1aca3899fb6d30724c9dba14b6503fbe6dc8f5dc (patch) | |
tree | 1c076bce820bfed032250e9f9c058e367ad1e943 /Lib/tkinter/tix.py | |
parent | a653196585363955092e7af6b80483672ccfe581 (diff) | |
parent | e6f0199c190754cf0da60f98f85e2503109e692d (diff) | |
download | cpython-1aca3899fb6d30724c9dba14b6503fbe6dc8f5dc.zip cpython-1aca3899fb6d30724c9dba14b6503fbe6dc8f5dc.tar.gz cpython-1aca3899fb6d30724c9dba14b6503fbe6dc8f5dc.tar.bz2 |
Issue #27611: Fixed support of default root window in the tkinter.tix module.
Added the master parameter in the DisplayStyle constructor.
Diffstat (limited to 'Lib/tkinter/tix.py')
-rw-r--r-- | Lib/tkinter/tix.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py index 04465aa..f3eb92e 100644 --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -472,11 +472,17 @@ class DisplayStyle: """DisplayStyle - handle configuration options shared by (multiple) Display Items""" - def __init__(self, itemtype, cnf={}, **kw): - master = tkinter._default_root # global from Tkinter - if not master and 'refwindow' in cnf: master=cnf['refwindow'] - elif not master and 'refwindow' in kw: master= kw['refwindow'] - elif not master: raise RuntimeError("Too early to create display style: no root window") + def __init__(self, itemtype, cnf={}, *, master=None, **kw): + if not master: + if 'refwindow' in kw: + master = kw['refwindow'] + elif 'refwindow' in cnf: + master = cnf['refwindow'] + else: + master = tkinter._default_root + if not master: + raise RuntimeError("Too early to create display style: " + "no root window") self.tk = master.tk self.stylename = self.tk.call('tixDisplayStyle', itemtype, *self._options(cnf,kw) ) |