]> granicus.if.org Git - python/commitdiff
Issue #27611: Fixed support of default root window in the Tix module.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 25 Sep 2016 13:44:32 +0000 (16:44 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 25 Sep 2016 13:44:32 +0000 (16:44 +0300)
Lib/lib-tk/Tix.py
Misc/NEWS

index 50938ccc42ad272a6f98217abbcc0bc2e4df0b86..a7b785e49a16b76bebe4fd6ca5c5fb34a9183092 100644 (file)
@@ -477,10 +477,14 @@ class DisplayStyle:
     (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) )
index 4fa9f7cf66d64bc053c4850c84669220aed9c236..2fcf5547744621d0c5a4ef09de384c2f6fe73d23 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #27611: Fixed support of default root window in the Tix module.
+
 - Issue #24363: When parsing HTTP header fields, if an invalid line is
   encountered, skip it and continue parsing.  Previously, no more header
   fields were parsed, which could lead to fields for HTTP framing like