【发布时间】:2015-08-26 16:03:13
【问题描述】:
def __init__(self):
self.root = Tk()
self.title = Frame(self.root, width = 500, height = 35)
self.title.pack(side = TOP, expand = True)
self.frame = Frame(self.root, width = 574, height = 574)
self.frame.grid(columnspan = 30, rowspan = 31)
self.label = Label(self.title, width = 300, height = 30)
self.label.pack()
self.root.mainloop()
我希望能够在网格顶部有一个标签,但是当我运行主循环时出现错误:“无法在 .55652592 内使用几何管理器网格,该网格已经有由包管理的从属。”谢谢。
【问题讨论】:
-
你到底想要什么布局?如果您希望标签出现在网格顶部,您可以使用
place。否则将网格化的小部件放在可以打包的框架内。