下面的measure方法是在class Font of /usr/lib/python3.5/tkinter/font或import tkinter.font中定义的
def measure(self, text, displayof=None):
"Return text width"
args = (text,)
if displayof:
args = ('-displayof', displayof, text)
return self._tk.getint(self._call("font", "measure", self.name, *args))问题:
displayof?displayof发布于 2018-02-11 16:50:50
它以一个小部件作为参数。虽然很少见,但有可能在不同像素密度的多个显示器上显示多个窗口。如果有这样的设置,就可以决定使用哪个小部件/显示作为确定字符串大小的基础。
此参数的默认设置是根窗口。
https://stackoverflow.com/questions/48733568
复制相似问题