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

Skip to content

Commit 1aca389

Browse files
Issue #27611: Fixed support of default root window in the tkinter.tix module.
Added the master parameter in the DisplayStyle constructor.
2 parents a653196 + e6f0199 commit 1aca389

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

Lib/tkinter/tix.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,17 @@ class DisplayStyle:
472472
"""DisplayStyle - handle configuration options shared by
473473
(multiple) Display Items"""
474474

475-
def __init__(self, itemtype, cnf={}, **kw):
476-
master = tkinter._default_root # global from Tkinter
477-
if not master and 'refwindow' in cnf: master=cnf['refwindow']
478-
elif not master and 'refwindow' in kw: master= kw['refwindow']
479-
elif not master: raise RuntimeError("Too early to create display style: no root window")
475+
def __init__(self, itemtype, cnf={}, *, master=None, **kw):
476+
if not master:
477+
if 'refwindow' in kw:
478+
master = kw['refwindow']
479+
elif 'refwindow' in cnf:
480+
master = cnf['refwindow']
481+
else:
482+
master = tkinter._default_root
483+
if not master:
484+
raise RuntimeError("Too early to create display style: "
485+
"no root window")
480486
self.tk = master.tk
481487
self.stylename = self.tk.call('tixDisplayStyle', itemtype,
482488
*self._options(cnf,kw) )

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ Core and Builtins
4141
Library
4242
-------
4343

44+
- Issue #27611: Fixed support of default root window in the tkinter.tix module.
45+
Added the master parameter in the DisplayStyle constructor.
46+
4447
- Issue #27348: In the traceback module, restore the formatting of exception
4548
messages like "Exception: None". This fixes a regression introduced in
4649
3.5a2.

0 commit comments

Comments
 (0)