I'm having trouble getting back to one screen without creating another ...
I could not get her to go back to the same canvas I created.
Can I use .destroy()
?
Here is the code:
from tkinter import *
def janela_principal():
janela1 = Tk()
janela1.geometry("300x300+200+200")
janela1 ["bg"] = "green"
bt1 = Button(janela1, text="abrir a segunda janela",command = janela_secundaria)
bt1.place(x = 50, y =100)
def janela_secundaria():
janela2 = Tk()
janela2.geometry("300x300+200+200")
janela2["bg"] = "green"
bt1 = Button(janela2, text = "Voltar", command = janela_principal)
bt1.place(x = 50, y = 100)
janela_principal()