我在python 3.6中使用了tkinter,所以我可以学习GUI编程。我试图创建一个按钮。当我尝试pack按,,或按钮时left,没有得到输出,而frame命令的工作正常。请帮助我。提前致谢。righttopbottomside=top from tkinter import * import tkinter as tk root = tk.Tk() topframe = Frame(root) topframe.pack() bottomframe = Frame(root) bottomframe.pack(side=BOTTOM) button1 = Button(topframe, text="helo boys", fg="green") button1.pack() button2 = Button(topframe, text="how are you", fg="red") button2.pack(side=LEFT) button3 = Button(bottomframe, text="we are fine", fg="blue") button3.pack(side=RIGHT) root.mainloop()
添加回答
举报
0/150
提交
取消