My python tkinter program will only show the first three buttons

Viewed 47

The program is meant to show 7 buttons but only shows the first three. I would appreciate some help, I'm trying to make a catalog program that writes files and text in those files. It works without tkinter, but the buttons arent showing up. I wrote the seven buttons and they worked originally but they have since stopped working. I don't know the problem since this is my first time with tkinter.

root = tk.Tk()
frame = tk.Frame(root)
frame.pack()
root.geometry("500x500")
root.title("Catalog 2020")

button = tk.Button(frame,
                    text = "Make New File",
                    command=answer1)
button.pack(side=tk.LEFT)

button2 = tk.Button(frame, 
                    text = "Edit File", 
                    command = answer2)
button2.pack(side=tk.LEFT)
button3 = tk.Button(frame, 
                    text = "Append Data", 
                    command = answer3)
button3.pack(side=tk.LEFT)
button4 = tk.Button(frame, 
                    text = "Read File", 
                    command = answer4)
button4.pack(side=tk.LEFT)
button5 = tk.Button(frame, 
                    text = "Delete File", 
                    command = answer5)
button5.pack(side=tk.LEFT)
button6 = tk.Button(frame, 
                    text = "Tell me a Joke", 
                    command = answer6)
button6.pack(side=tk.LEFT)
buttonquit = tk.Button(frame, 
                text="QUIT", 
                fg="red",
                command=quit)
buttonquit.pack
root.mainloop()
1 Answers

With root.geometry('500x500') your asking your window to be '500x500' , remove that line to fit all the window with the widgets. Also you forgot to say () with the pack of last button, like buttonquit.pack() or you wont see that button too.

Related