【发布时间】:2021-01-05 09:21:28
【问题描述】:
在这里,我需要将按钮放在 homeFrame 中。但我不能把按钮放在那里。有什么问题?请解决。这是代码。
from tkinter import *
root = Tk()
root.state('zoomed')
root.configure(bg='#498240')
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
headFrame = Frame(root,width=screen_width,height=120,bd=10,bg='#498240',relief=RIDGE).grid(row=0,column=0)
headlable = Label(headFrame,text='Super Market',fg='white',bg='#498240',font=('times new roman',55,'bold')).grid(row=0,column=0)
homeFrame = Frame(root,width=screen_width,height=screen_height-200,bd=10,bg='#498240',relief=RIDGE).grid(row=1,column=0)
homeBtn = Button(homeFrame,text='Customer Management').grid(row=0,column=0)
root.mainloop()
这里我提到了按钮的位置,请帮我把按钮放在那里。
【问题讨论】:
-
@Atlas435 我已经搜索了所有但无法解决请您解决这个问题!
标签: python user-interface tkinter