0
I’m having trouble getting back to one screen without creating another...
I couldn’t get her to come back to the same screen I created.
I wonder if I could use the .destroy()
?
Follow the code below:
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()
When I messed with
TkInter
, I always worked in the same window. I would touch the contents of it, but I would never destroy it– Jefferson Quesado