【发布时间】:2020-12-28 22:25:47
【问题描述】:
希望到目前为止我们每个人都度过了美好的圣诞节!
在这段代码中我需要一些关于我的字体大小的帮助:
import Pmw
from tkinter import *
import tkinter.font
root = Tk()
root.title("Dashboard")
root.attributes('-zoomed', True)
filename = "SMS.txt"
top = Frame(root); top.pack(side='top')
text = Pmw.ScrolledText(top,
borderframe=5,
vscrollmode='dynamic',
hscrollmode='dynamic',
labelpos='n',
label_text='Todays Data %s' % filename,
text_width=120,
text_height=35,
text_wrap='none',
text_padx=14,
text_pady=14,
)
text.pack()
text.insert('end', open(filename,'r').read())
root.mainloop()
我希望文本区域的字体很大,以便在我的 3 英寸树莓派显示器上看到。
提前谢谢你!
【问题讨论】:
-
这是有文档的,并且可能在几乎每个 tkinter 教程中都提到过。你做过研究吗?为什么需要 Stackoverflow 的帮助?
-
当
tkinter有自己的ScrolledText时,为什么还要使用Pmw
标签: python-3.x user-interface tkinter