Issue #23880: Tkinter's getint() and getdouble() now support Tcl_Obj.

Tkinter's getdouble() now supports any numbers (in particular int).
This commit is contained in:
Serhiy Storchaka 2015-05-06 14:00:04 +03:00
parent 008d88b462
commit 645058d11a
9 changed files with 115 additions and 84 deletions

View file

@ -153,7 +153,7 @@ class Font:
args = (text,)
if displayof:
args = ('-displayof', displayof, text)
return int(self._call("font", "measure", self.name, *args))
return self._root.tk.getint(self._call("font", "measure", self.name, *args))
def metrics(self, *options, **kw):
"""Return font metrics.
@ -166,13 +166,13 @@ class Font:
args = ('-displayof', displayof)
if options:
args = args + self._get(options)
return int(
return self._root.tk.getint(
self._call("font", "metrics", self.name, *args))
else:
res = self._split(self._call("font", "metrics", self.name, *args))
options = {}
for i in range(0, len(res), 2):
options[res[i][1:]] = int(res[i+1])
options[res[i][1:]] = self._root.tk.getint(res[i+1])
return options