【发布时间】:2015-12-01 23:21:00
【问题描述】:
Python 2.7 版(我知道它已经过时了) 我已经搜索了几个答案,但没有找到解决方案。我正在尝试获得这个标签:
w = Label(root, text="This label", fg="red", font=("Helvetica", 16))
w.grid(row=5, column=20)
基本上到任何其他列,而不是它所在的列(中心)。简单地说,行工作,列不工作。
这是脚本:
from Tkinter import *
root = Tk()
root.wm_title("Title:D")
root.geometry('{}x{}'.format(500, 250))
photo = PhotoImage(file="spaz.gif")
label = Label(root, image=photo)
label.grid(row=1, column=1)
w = Label(root, text="This label", fg="red", font=("Helvetica", 16))
w.grid(row=5, column=20)
root.mainloop()
【问题讨论】:
-
其他列有 in 内容吗? Tkinter 几何管理器将根据需要扩展或缩小其行和列以适应内容。
标签: python python-2.7 tkinter