Aug-04-2020, 11:58 PM
I am a beginner trying to learn Tkinter.
The objectives of the following code are to
1) Show a red "Press here to start button."
2) After the "Press here to start button is pressed it disappears and 5 option command buttons come up.
Questions
1) The red "Press here to start button" does not disappear, when the option buttons appear. I know I could use pack_forget or destroy to accomplish this but I can't get them to work.
2) Is using a function to get the second set of command buttons to come up, the usual way this is done or is there a better way?
The objectives of the following code are to
1) Show a red "Press here to start button."
2) After the "Press here to start button is pressed it disappears and 5 option command buttons come up.
Questions
1) The red "Press here to start button" does not disappear, when the option buttons appear. I know I could use pack_forget or destroy to accomplish this but I can't get them to work.
2) Is using a function to get the second set of command buttons to come up, the usual way this is done or is there a better way?
from tkinter import * root = Tk() root.geometry("800x800") #Secondmenu brings up a second set of buttons. How do I make the "Press here to starbutton" disappear before this second set of buttons come up def secondmenu(): Option1 = Button(root, text="Option1", bg="white", \ fg="firebrick", relief = "groove", font = "Helvitica 30",).pack() Option2 = Button(root, text="Option2", bg="white", \ fg="firebrick", relief = "groove", font = "Helvitica 30",).pack() Option3 = Button(root, text="Option3", bg="white", \ fg="firebrick", relief = "groove", font = "Helvitica 30", ).pack() Option4 = Button(root, text="Option4", bg="white", \ fg="firebrick", relief = "groove", font = "Helvitica 30", ).pack() Option5 = Button(root, text="Option5", bg="white", \ fg="firebrick", relief = "groove", font = "Helvitica 30",).pack() #This is the button you will see when you start the program start = Button(root, text="Press here to start", bg="red", fg="black", font = "Helvitica 30",command = secondmenu).pack() #start.pack_forget() root.mainloop()