summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/tix.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-25 14:35:38 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-25 14:35:38 (GMT)
commit848972cac1d8a1d5a8828c807dbdaa26c2567b2c (patch)
tree32657f1397319708535cce9ececb91a13b92f8c2 /Lib/tkinter/tix.py
parent0fd557647d9957542a68972854a227d2def5f5f3 (diff)
downloadcpython-848972cac1d8a1d5a8828c807dbdaa26c2567b2c.zip
cpython-848972cac1d8a1d5a8828c807dbdaa26c2567b2c.tar.gz
cpython-848972cac1d8a1d5a8828c807dbdaa26c2567b2c.tar.bz2
Issue #19020: Tkinter now uses splitlist() instead of split() in configure
methods.
Diffstat (limited to 'Lib/tkinter/tix.py')
-rw-r--r--Lib/tkinter/tix.py44
1 files changed, 11 insertions, 33 deletions
diff --git a/Lib/tkinter/tix.py b/Lib/tkinter/tix.py
index 5eecd04..131aa06 100644
--- a/Lib/tkinter/tix.py
+++ b/Lib/tkinter/tix.py
@@ -122,13 +122,9 @@ class tixCommand:
elif cnf:
cnf = _cnfmerge(cnf)
if cnf is None:
- cnf = {}
- for x in self.tk.split(self.tk.call('tix', 'configure')):
- cnf[x[0][1:]] = (x[0][1:],) + x[1:]
- return cnf
+ return self._getconfigure('tix', 'configure')
if isinstance(cnf, str):
- x = self.tk.split(self.tk.call('tix', 'configure', '-'+cnf))
- return (x[0][1:],) + x[1:]
+ return self._getconfigure1('tix', 'configure', '-'+cnf)
return self.tk.call(('tix', 'configure') + self._options(cnf))
def tix_filedialog(self, dlgclass=None):
@@ -380,7 +376,7 @@ class TixWidget(tkinter.Widget):
"""Return the name of all subwidgets."""
try:
x = self.tk.call(self._w, 'subwidgets', '-all')
- return self.tk.split(x)
+ return self.tk.splitlist(x)
except TclError:
return None
@@ -473,13 +469,6 @@ class TixSubWidget(TixWidget):
self.tk.call('destroy', self._w)
-# Useful func. to split Tcl lists and return as a dict. From Tkinter.py
-def _lst2dict(lst):
- dict = {}
- for x in lst:
- dict[x[0][1:]] = (x[0][1:],) + x[1:]
- return dict
-
# Useful class to create a display style - later shared by many items.
# Contributed by Steffen Kremser
class DisplayStyle:
@@ -515,10 +504,8 @@ class DisplayStyle:
self.tk.call(self.stylename, 'configure', '-%s'%key, value)
def config(self, cnf={}, **kw):
- return _lst2dict(
- self.tk.split(
- self.tk.call(
- self.stylename, 'configure', *self._options(cnf,kw))))
+ return self._getconfigure(
+ self.stylename, 'configure', *self._options(cnf,kw))
def __getitem__(self,key):
return self.tk.call(self.stylename, 'cget', '-%s'%key)
@@ -928,9 +915,7 @@ class HList(TixWidget, XView, YView):
def header_configure(self, col, cnf={}, **kw):
if cnf is None:
- return _lst2dict(
- self.tk.split(
- self.tk.call(self._w, 'header', 'configure', col)))
+ return self._getconfigure(self._w, 'header', 'configure', col)
self.tk.call(self._w, 'header', 'configure', col,
*self._options(cnf, kw))
@@ -955,9 +940,8 @@ class HList(TixWidget, XView, YView):
def indicator_configure(self, entry, cnf={}, **kw):
if cnf is None:
- return _lst2dict(
- self.tk.split(
- self.tk.call(self._w, 'indicator', 'configure', entry)))
+ return self._getconfigure(
+ self._w, 'indicator', 'configure', entry)
self.tk.call(
self._w, 'indicator', 'configure', entry, *self._options(cnf, kw))
@@ -1017,9 +1001,7 @@ class HList(TixWidget, XView, YView):
def item_configure(self, entry, col, cnf={}, **kw):
if cnf is None:
- return _lst2dict(
- self.tk.split(
- self.tk.call(self._w, 'item', 'configure', entry, col)))
+ return self._getconfigure(self._w, 'item', 'configure', entry, col)
self.tk.call(self._w, 'item', 'configure', entry, col,
*self._options(cnf, kw))
@@ -1038,9 +1020,7 @@ class HList(TixWidget, XView, YView):
def entryconfigure(self, entry, cnf={}, **kw):
if cnf is None:
- return _lst2dict(
- self.tk.split(
- self.tk.call(self._w, 'entryconfigure', entry)))
+ return self._getconfigure(self._w, 'entryconfigure', entry)
self.tk.call(self._w, 'entryconfigure', entry,
*self._options(cnf, kw))
@@ -1254,9 +1234,7 @@ class PanedWindow(TixWidget):
def paneconfigure(self, entry, cnf={}, **kw):
if cnf is None:
- return _lst2dict(
- self.tk.split(
- self.tk.call(self._w, 'paneconfigure', entry)))
+ return self._getconfigure(self._w, 'paneconfigure', entry)
self.tk.call(self._w, 'paneconfigure', entry, *self._options(cnf, kw))
def panes(self):