@@ -122,13 +122,9 @@ def tix_configure(self, cnf=None, **kw):
122122 elif cnf :
123123 cnf = _cnfmerge (cnf )
124124 if cnf is None :
125- cnf = {}
126- for x in self .tk .split (self .tk .call ('tix' , 'configure' )):
127- cnf [x [0 ][1 :]] = (x [0 ][1 :],) + x [1 :]
128- return cnf
125+ return self ._getconfigure ('tix' , 'configure' )
129126 if isinstance (cnf , str ):
130- x = self .tk .split (self .tk .call ('tix' , 'configure' , '-' + cnf ))
131- return (x [0 ][1 :],) + x [1 :]
127+ return self ._getconfigure1 ('tix' , 'configure' , '-' + cnf )
132128 return self .tk .call (('tix' , 'configure' ) + self ._options (cnf ))
133129
134130 def tix_filedialog (self , dlgclass = None ):
@@ -380,7 +376,7 @@ def _subwidget_names(self):
380376 """Return the name of all subwidgets."""
381377 try :
382378 x = self .tk .call (self ._w , 'subwidgets' , '-all' )
383- return self .tk .split (x )
379+ return self .tk .splitlist (x )
384380 except TclError :
385381 return None
386382
@@ -473,13 +469,6 @@ def destroy(self):
473469 self .tk .call ('destroy' , self ._w )
474470
475471
476- # Useful func. to split Tcl lists and return as a dict. From Tkinter.py
477- def _lst2dict (lst ):
478- dict = {}
479- for x in lst :
480- dict [x [0 ][1 :]] = (x [0 ][1 :],) + x [1 :]
481- return dict
482-
483472# Useful class to create a display style - later shared by many items.
484473# Contributed by Steffen Kremser
485474class DisplayStyle :
@@ -515,10 +504,8 @@ def __setitem__(self,key,value):
515504 self .tk .call (self .stylename , 'configure' , '-%s' % key , value )
516505
517506 def config (self , cnf = {}, ** kw ):
518- return _lst2dict (
519- self .tk .split (
520- self .tk .call (
521- self .stylename , 'configure' , * self ._options (cnf ,kw ))))
507+ return self ._getconfigure (
508+ self .stylename , 'configure' , * self ._options (cnf ,kw ))
522509
523510 def __getitem__ (self ,key ):
524511 return self .tk .call (self .stylename , 'cget' , '-%s' % key )
@@ -928,9 +915,7 @@ def header_create(self, col, cnf={}, **kw):
928915
929916 def header_configure (self , col , cnf = {}, ** kw ):
930917 if cnf is None :
931- return _lst2dict (
932- self .tk .split (
933- self .tk .call (self ._w , 'header' , 'configure' , col )))
918+ return self ._getconfigure (self ._w , 'header' , 'configure' , col )
934919 self .tk .call (self ._w , 'header' , 'configure' , col ,
935920 * self ._options (cnf , kw ))
936921
@@ -955,9 +940,8 @@ def indicator_create(self, entry, cnf={}, **kw):
955940
956941 def indicator_configure (self , entry , cnf = {}, ** kw ):
957942 if cnf is None :
958- return _lst2dict (
959- self .tk .split (
960- self .tk .call (self ._w , 'indicator' , 'configure' , entry )))
943+ return self ._getconfigure (
944+ self ._w , 'indicator' , 'configure' , entry )
961945 self .tk .call (
962946 self ._w , 'indicator' , 'configure' , entry , * self ._options (cnf , kw ))
963947
@@ -1017,9 +1001,7 @@ def item_cget(self, entry, col, opt):
10171001
10181002 def item_configure (self , entry , col , cnf = {}, ** kw ):
10191003 if cnf is None :
1020- return _lst2dict (
1021- self .tk .split (
1022- self .tk .call (self ._w , 'item' , 'configure' , entry , col )))
1004+ return self ._getconfigure (self ._w , 'item' , 'configure' , entry , col )
10231005 self .tk .call (self ._w , 'item' , 'configure' , entry , col ,
10241006 * self ._options (cnf , kw ))
10251007
@@ -1038,9 +1020,7 @@ def entrycget(self, entry, opt):
10381020
10391021 def entryconfigure (self , entry , cnf = {}, ** kw ):
10401022 if cnf is None :
1041- return _lst2dict (
1042- self .tk .split (
1043- self .tk .call (self ._w , 'entryconfigure' , entry )))
1023+ return self ._getconfigure (self ._w , 'entryconfigure' , entry )
10441024 self .tk .call (self ._w , 'entryconfigure' , entry ,
10451025 * self ._options (cnf , kw ))
10461026
@@ -1254,9 +1234,7 @@ def panecget(self, entry, opt):
12541234
12551235 def paneconfigure (self , entry , cnf = {}, ** kw ):
12561236 if cnf is None :
1257- return _lst2dict (
1258- self .tk .split (
1259- self .tk .call (self ._w , 'paneconfigure' , entry )))
1237+ return self ._getconfigure (self ._w , 'paneconfigure' , entry )
12601238 self .tk .call (self ._w , 'paneconfigure' , entry , * self ._options (cnf , kw ))
12611239
12621240 def panes (self ):
0 commit comments