【发布时间】:2021-01-04 07:08:32
【问题描述】:
我在 tkinter 中创建了一个文本区域,我希望每次调整窗口大小时它的大小都适合 Tk()!
这是我的代码:
from tkinter import *
#The window:
app = Tk()
#The size of the screen:
s_width = app.winfo_screenwidth()
s_height = app.winfo_screenheight()
#The text area:
text_area = Text(app, width = s_width, height = s_height)
text_area.place(x = 0, y = 0)
#mainloop
app.mainloop()
但这给 text_area 带来了奇怪的大小!
我希望 text_area 的大小与 app 变量一样大!
我该怎么做?
每次我调整屏幕大小时它都应该调整大小!
【问题讨论】:
标签: python tkinter text resize