mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #24408: Fixed AttributeError in measure() and metrics() methods of
tkinter.Font.
This commit is contained in:
parent
391af751f2
commit
4fafda731a
2 changed files with 6 additions and 3 deletions
|
@ -151,7 +151,7 @@ class Font:
|
|||
args = (text,)
|
||||
if displayof:
|
||||
args = ('-displayof', displayof, text)
|
||||
return self._root.tk.getint(self._call("font", "measure", self.name, *args))
|
||||
return self._tk.getint(self._call("font", "measure", self.name, *args))
|
||||
|
||||
def metrics(self, *options, **kw):
|
||||
"""Return font metrics.
|
||||
|
@ -164,13 +164,13 @@ class Font:
|
|||
args = ('-displayof', displayof)
|
||||
if options:
|
||||
args = args + self._get(options)
|
||||
return self._root.tk.getint(
|
||||
return self._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:]] = self._root.tk.getint(res[i+1])
|
||||
options[res[i][1:]] = self._tk.getint(res[i+1])
|
||||
return options
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue