_tkinter.TclError: can't invoke "button" command: application has been destroyed
Question:
You cant see the button
It wont work this is the code:
P.S. i put ? for personal stuff
sito = tk.Tk()
sito.geometry("800x500")
sito.title("???")
label = tk.Label(sito, text="???", font=('Arial', 18))
label.pack()
sito.mainloop()
def new_banana():
sito1 = tk.Tk()
sito1.geometry("800x500")
sito1.title("???")
label1 = tk.Label(sito1, text="???", font=('Arial', 18))
label1.pack()
sito1.mainloop()
Button1 = Button(sito, text="???", command=new_banana)
Button1.pack()
Answers:
#Try putting mainloop at the bottom?
sito = tk.Tk()
sito.geometry("800x500")
sito.title("???")
label = tk.Label(sito, text="???", font=('Arial', 18))
label.pack()
def new_banana():
sito1 = tk.Tk()
sito1.geometry("800x500")
sito1.title("???")
label1 = tk.Label(sito1, text="???", font=('Arial', 18))
label1.pack()
sito1.mainloop()
Button1 = Button(sito, text="???", command=new_banana)
Button1.pack()
sito.mainloop()
#let me know if this worked
I put mainloop at the bottom and now it works
You cant see the button
It wont work this is the code:
P.S. i put ? for personal stuff
sito = tk.Tk()
sito.geometry("800x500")
sito.title("???")
label = tk.Label(sito, text="???", font=('Arial', 18))
label.pack()
sito.mainloop()
def new_banana():
sito1 = tk.Tk()
sito1.geometry("800x500")
sito1.title("???")
label1 = tk.Label(sito1, text="???", font=('Arial', 18))
label1.pack()
sito1.mainloop()
Button1 = Button(sito, text="???", command=new_banana)
Button1.pack()
#Try putting mainloop at the bottom?
sito = tk.Tk()
sito.geometry("800x500")
sito.title("???")
label = tk.Label(sito, text="???", font=('Arial', 18))
label.pack()
def new_banana():
sito1 = tk.Tk()
sito1.geometry("800x500")
sito1.title("???")
label1 = tk.Label(sito1, text="???", font=('Arial', 18))
label1.pack()
sito1.mainloop()
Button1 = Button(sito, text="???", command=new_banana)
Button1.pack()
sito.mainloop()
#let me know if this worked
I put mainloop at the bottom and now it works