diff options
Diffstat (limited to 'Lib/tkinter/tix.py')
-rw-r--r-- | Lib/tkinter/tix.py | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py index a1006bdf84..d9c097a77c 100644 --- a/Lib/tkinter/tix.py +++ b/Lib/tkinter/tix.py @@ -27,10 +27,6 @@ import tkinter from tkinter import * from tkinter import _cnfmerge -# WARNING - TkVersion is a limited precision floating point number -if TkVersion < 3.999: - raise ImportError("This version of Tix.py requires Tk 4.0 or higher") - import _tkinter # If this fails your Python may not be configured for Tk # Some more constants (for consistency with Tkinter) @@ -472,16 +468,17 @@ class DisplayStyle: """DisplayStyle - handle configuration options shared by (multiple) Display Items""" - def __init__(self, itemtype, cnf={}, **kw): - 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") + def __init__(self, itemtype, cnf={}, *, master=None, **kw): + if not master: + 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) ) @@ -1116,7 +1113,7 @@ class ListNoteBook(TixWidget): def pages(self): # Can't call subwidgets_all directly because we don't want .nbframe - names = self.tk.split(self.tk.call(self._w, 'pages')) + names = self.tk.splitlist(self.tk.call(self._w, 'pages')) ret = [] for x in names: ret.append(self.subwidget(x)) @@ -1162,7 +1159,7 @@ class NoteBook(TixWidget): def pages(self): # Can't call subwidgets_all directly because we don't want .nbframe - names = self.tk.split(self.tk.call(self._w, 'pages')) + names = self.tk.splitlist(self.tk.call(self._w, 'pages')) ret = [] for x in names: ret.append(self.subwidget(x)) @@ -1585,8 +1582,7 @@ class CheckList(TixWidget): '''Returns a list of items whose status matches status. If status is not specified, the list of items in the "on" status will be returned. Mode can be on, off, default''' - c = self.tk.split(self.tk.call(self._w, 'getselection', mode)) - return self.tk.splitlist(c) + return self.tk.splitlist(self.tk.call(self._w, 'getselection', mode)) def getstatus(self, entrypath): '''Returns the current status of entryPath.''' @@ -1907,7 +1903,7 @@ class Grid(TixWidget, XView, YView): or a real number following by the word chars (e.g. 3.4chars) that sets the width of the column to the given number of characters.""" - return self.tk.split(self.tk.call(self._w, 'size', 'column', index, + return self.tk.splitlist(self.tk.call(self._w, 'size', 'column', index, *self._options({}, kw))) def size_row(self, index, **kw): @@ -1932,7 +1928,7 @@ class Grid(TixWidget, XView, YView): or a real number following by the word chars (e.g. 3.4chars) that sets the height of the row to the given number of characters.""" - return self.tk.split(self.tk.call( + return self.tk.splitlist(self.tk.call( self, 'size', 'row', index, *self._options({}, kw))) def unset(self, x, y): |