mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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:
parent
008d88b462
commit
645058d11a
9 changed files with 115 additions and 84 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue