Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

My button is not appearing on my Tkinter project

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()

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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")

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading