Issue #27611: Fixed support of default root window in the Tix module.
diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py
index 50938cc..a7b785e 100644
--- a/Lib/lib-tk/Tix.py
+++ b/Lib/lib-tk/Tix.py
@@ -477,10 +477,14 @@
(multiple) Display Items"""
def __init__(self, itemtype, cnf={}, **kw):
- master = Tkinter._default_root
- 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"
+ 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) )