Kiw*_*iwi 6 python user-interface tkinter
使用此代码,窗口是500乘500,这是我要的:
from tkinter import *
root = Tk()
frame = Frame(root, width=500, height=500)
frame.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
但是,当我向框架添加文本框时,它会缩小到文本框的大小:
from tkinter import *
root = Tk()
frame = Frame(root, width=500, height=500)
text = Text(frame, width=10, height=2) # THESE TWO
text.pack() # LINES HERE
frame.pack()
root.mainloop()
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况,我该如何防止它发生?
| 归档时间: |
|
| 查看次数: |
1903 次 |
| 最近记录: |