Redo these changes:

(Menu.index): return int or None, not string
	(Widget.__getitem__): use splitlist, not split
This commit is contained in:
Guido van Rossum 1994-06-27 07:55:59 +00:00
parent aec5dc9f67
commit 535cf0cbe2
2 changed files with 8 additions and 4 deletions

View File

@ -583,7 +583,7 @@ def config(self, cnf=None):
apply(self.tk.call, (self._w, 'configure')
+ self._options(cnf))
def __getitem__(self, key):
v = self.tk.split(self.tk.call(
v = self.tk.splitlist(self.tk.call(
self._w, 'configure', '-' + key))
return v[4]
def __setitem__(self, key, value):
@ -940,7 +940,9 @@ def entryconfig(self, index, cnf={}):
apply(self.tk.call, (self._w, 'entryconfigure', index)
+ self._options(cnf))
def index(self, index):
return self.tk.call(self._w, 'index', index)
i = self.tk.call(self._w, 'index', index)
if i == 'none': return None
return self.tk.getint(i)
def invoke(self, index):
return self.tk.call(self._w, 'invoke', index)
def post(self, x, y):

View File

@ -583,7 +583,7 @@ def config(self, cnf=None):
apply(self.tk.call, (self._w, 'configure')
+ self._options(cnf))
def __getitem__(self, key):
v = self.tk.split(self.tk.call(
v = self.tk.splitlist(self.tk.call(
self._w, 'configure', '-' + key))
return v[4]
def __setitem__(self, key, value):
@ -940,7 +940,9 @@ def entryconfig(self, index, cnf={}):
apply(self.tk.call, (self._w, 'entryconfigure', index)
+ self._options(cnf))
def index(self, index):
return self.tk.call(self._w, 'index', index)
i = self.tk.call(self._w, 'index', index)
if i == 'none': return None
return self.tk.getint(i)
def invoke(self, index):
return self.tk.call(self._w, 'invoke', index)
def post(self, x, y):