changeset: 104058:ec3f5d21bec0 branch: 3.6 parent: 104054:58740ad9e568 parent: 104057:7b458bcdab75 user: Serhiy Storchaka date: Sun Sep 25 16:52:13 2016 +0300 files: Lib/tkinter/tix.py Misc/NEWS description: Issue #27611: Fixed support of default root window in the tkinter.tix module. Added the master parameter in the DisplayStyle constructor. diff -r 58740ad9e568 -r ec3f5d21bec0 Lib/tkinter/tix.py --- a/Lib/tkinter/tix.py Sat Sep 24 09:31:23 2016 -0700 +++ b/Lib/tkinter/tix.py Sun Sep 25 16:52:13 2016 +0300 @@ -472,11 +472,17 @@ """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) ) diff -r 58740ad9e568 -r ec3f5d21bec0 Misc/NEWS --- a/Misc/NEWS Sat Sep 24 09:31:23 2016 -0700 +++ b/Misc/NEWS Sun Sep 25 16:52:13 2016 +0300 @@ -41,6 +41,9 @@ Library ------- +- Issue #27611: Fixed support of default root window in the tkinter.tix module. + Added the master parameter in the DisplayStyle constructor. + - Issue #27348: In the traceback module, restore the formatting of exception messages like "Exception: None". This fixes a regression introduced in 3.5a2.