我正在尝试运行以下代码:
from tkinter import *
root = Tk()
topFrame = Frame(root)
topFrame.pack(side=TOP)
leftFrame = Frame(root)
leftFrame.pack(side=LEFT)
botFrame = Frame(root)
botFrame.pack(side=BOTTOM)
button1 = Button(leftFrame, text="Button 1", fg="Black")
button2 = Button(leftFrame, text="Button 2", fg="Black")
button3 = Button(leftFrame, text="Button 3", fg="Black")
button1.grid(row=0, column=0)
button2.grid(row=1, column=0)
button3.grid(row=2, column=0)
ScaleWidget = Scale(root, from_=0, to=100)
ScaleWidget.grid(row=0, column=1)
ScaleWidget = Scale(root, from_=0, to=100, orient=HORIZONTAL)
ScaleWidget.grid(row=0, column=1)
root.mainloop()
但是,我得到以下错误消息:
^{pr2}$我不知道该怎么办,非常感谢您的帮助,谢谢!在
对于共享同一父项的windows,不应混合使用网格管理器和包管理器:
来源:http://effbot.org/tkinterbook/grid.htm
相关问题 更多 >
编程相关推荐