aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/tkinter/tix.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tkinter/tix.py')
-rw-r--r--Lib/tkinter/tix.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
index ac545502e45..ef1e7406bc1 100644
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -387,9 +387,7 @@ class TixWidget(tkinter.Widget):
# These are missing from Tkinter
def image_create(self, imgtype, cnf={}, master=None, **kw):
if not master:
- master = tkinter._default_root
- if not master:
- raise RuntimeError('Too early to create image')
+ master = self
if kw and cnf: cnf = _cnfmerge((cnf, kw))
elif kw: cnf = kw
options = ()
@@ -475,10 +473,7 @@ class DisplayStyle:
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")
+ master = tkinter._get_default_root('create display style')
self.tk = master.tk
self.stylename = self.tk.call('tixDisplayStyle', itemtype,
*self._options(cnf,kw) )