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

index 89113fd1eb0ce30b827da22436d6ccd1606f2fdb..7fb4bc54177878e9ae38c8bd2e0e47bb6f0da31f 100644 (file)
@@ -477,10 +477,15 @@ class DisplayStyle:
     (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")
+        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 8c9dcc36969f74caab6027cc9c8cda264287f4a9..2ec7c9d477c9b9a73407259f728a775d6a989b7f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -80,6 +80,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #27611: Fixed support of default root window in the tkinter.tix module.
+
 - Issue #27348: In the traceback module, restore the formatting of exception
   messages like "Exception: None".  This fixes a regression introduced in
   3.5a2.