我在python 3.6中使用了tkinter,所以我可以學(xué)習(xí)GUI編程。我試圖創(chuàng)建一個按鈕。當(dāng)我嘗試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
提交
取消