Why isn't my button showing up on my Tkinter project?
def mainMenu():
window = tk.Tk()
window.title("Main Menu")
window.geometry("400x400")
window.rowconfigure(0, minsize=200, weight=1)
window.columnconfigure(1, minsize=200, weight=1)
buttonsFrame = tk.Frame(master=window)
POSBtn = tk.Button(master=buttonsFrame, text="POS", bg="red")
POSBtn.place(x=200,y=200, width=250,height=250)
buttonsFrame.grid(row=0,column=0,sticky="nsew")
window.mainloop()
if __name__ == "__main__":
mainMenu()
CodePudding user response:
You have a problem with your grid, try this:
Change window.columnconfigure(1, minsize=200, weight=1)
to window.columnconfigure(0, minsize=200, weight=1)
or if you need columnconfigure as 1 then
Change buttonsFrame.grid(row=0,column=0,sticky="nsew")
to buttonsFrame.grid(row=0,column=1,sticky="nsew")