Kaydet (Commit) 4fafda73 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24408: Fixed AttributeError in measure() and metrics() methods of

tkinter.Font.
üst 391af751
...@@ -151,7 +151,7 @@ class Font: ...@@ -151,7 +151,7 @@ class Font:
args = (text,) args = (text,)
if displayof: if displayof:
args = ('-displayof', displayof, text) 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): def metrics(self, *options, **kw):
"""Return font metrics. """Return font metrics.
...@@ -164,13 +164,13 @@ class Font: ...@@ -164,13 +164,13 @@ class Font:
args = ('-displayof', displayof) args = ('-displayof', displayof)
if options: if options:
args = args + self._get(options) args = args + self._get(options)
return self._root.tk.getint( return self._tk.getint(
self._call("font", "metrics", self.name, *args)) self._call("font", "metrics", self.name, *args))
else: else:
res = self._split(self._call("font", "metrics", self.name, *args)) res = self._split(self._call("font", "metrics", self.name, *args))
options = {} options = {}
for i in range(0, len(res), 2): 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 return options
......
...@@ -15,6 +15,9 @@ Core and Builtins ...@@ -15,6 +15,9 @@ Core and Builtins
Library Library
------- -------
- Issue #24408: Fixed AttributeError in measure() and metrics() methods of
tkinter.Font.
- Issue #14373: C implementation of functools.lru_cache() now can be used with - Issue #14373: C implementation of functools.lru_cache() now can be used with
methods. methods.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment