【发布时间】:2020-04-12 21:42:50
【问题描述】:
我对使用 tkinter 完全陌生,目前正在玩网格。我已将窗口设置为 1000x500,并在左上角有这样的图像...
window = Tk()
window.geometry("1000x500") #Width x Height
logo = PhotoImage(file="logo.gif")
Label (window, image=logo, bg="#f0f0f0") .grid(row=0, column=0)
T = Text(window, height=2, width=30)
T.insert(END, "Just a text Widget\nin two lines\n")
T.grid(row=2, column=0)
我希望将文本小部件放置在窗口底部,我已尝试将行设置为更大但没有任何效果。
我哪里错了?
【问题讨论】:
-
我哪里出错了?:您的第 1 行是空的,因此布局管理器使用高度 0。阅读python-3-6-resizing-tkinter-buttons-in-accordance-with-frame-size