[Python-checkins] cpython (3.5): Issue #27611: Fixed support of default root window in the tkinter.tix module.

serhiy.storchaka python-checkins at python.org
Sun Sep 25 09:54:42 EDT 2016


https://hg.python.org/cpython/rev/7b458bcdab75
changeset:   104057:7b458bcdab75
branch:      3.5
parent:      104051:92f4ce2d5ebb
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sun Sep 25 16:46:10 2016 +0300
summary:
  Issue #27611: Fixed support of default root window in the tkinter.tix module.

files:
  Lib/tkinter/tix.py |  13 +++++++++----
  Misc/NEWS          |   2 ++
  2 files changed, 11 insertions(+), 4 deletions(-)


diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -477,10 +477,15 @@
     (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) )
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -80,6 +80,8 @@
 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.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list