Home > Software engineering >  Python Tkinter Button not appearing
Python Tkinter Button not appearing

Time:01-04

I tried to create two buttons, a 'Ratings List' button and a 'Rankings List' button.

The 'Rankings Button' appears as it should, but the 'Ratings Button' does not appear at all.

This is the code that I am using:

#Creating a new screen
screen = Toplevel(root)
screen.title("App")
screen.geometry("925x500 300 200")
screen.config(bg="white")

myFont = font.Font(size=15)

Label (screen, text="Please choose the Rankings or the Ratings", bg='#fff', font=('Calibri(Body)',25,'bold')).pack(expand=False)

ranking_button = Button(screen,width=15,text='Rankings List', border=2, bg='white',cursor='hand2',fg='#57a1f8')
ranking_button['font'] = myFont
ranking_button.place(x=100,y=200)

rating_button = Button(screen,width=15,text='Ratings List', border=2, bg='white',cursor='hand2',fg='#57a1f8')
rating_button['font'] = myFont
rating_button.place(x=100,y=500)

screen.mainloop()

Any help would be greatly appreciated.

CodePudding user response:

I think your window height is a bit too small, not enough to display the second button. Try to increase the height:

window.geometry("925x600 300 200")
  • Related