Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e6f0199

Browse files
Issue #27611: Fixed support of default root window in the tkinter.tix module.
1 parent 613f8e5 commit e6f0199

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

Lib/tkinter/tix.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,15 @@ class DisplayStyle:
477477
(multiple) Display Items"""
478478

479479
def __init__(self, itemtype, cnf={}, **kw):
480-
master = tkinter._default_root # global from Tkinter
481-
if not master and 'refwindow' in cnf: master=cnf['refwindow']
482-
elif not master and 'refwindow' in kw: master= kw['refwindow']
483-
elif not master: raise RuntimeError("Too early to create display style: no root window")
480+
if 'refwindow' in kw:
481+
master = kw['refwindow']
482+
elif 'refwindow' in cnf:
483+
master = cnf['refwindow']
484+
else:
485+
master = tkinter._default_root
486+
if not master:
487+
raise RuntimeError("Too early to create display style: "
488+
"no root window")
484489
self.tk = master.tk
485490
self.stylename = self.tk.call('tixDisplayStyle', itemtype,
486491
*self._options(cnf,kw) )

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ Core and Builtins
8080
Library
8181
-------
8282

83+
- Issue #27611: Fixed support of default root window in the tkinter.tix module.
84+
8385
- Issue #27348: In the traceback module, restore the formatting of exception
8486
messages like "Exception: None". This fixes a regression introduced in
8587
3.5a2.

0 commit comments

Comments
 (0)