In my code there is a frame with a button and it is called "Open", clicking "Open" will bring up another window.
The problem is that if I click on the window that is the "Open" button again, it will open a new window.
What I want is to be able to switch between all the open windows by selecting any one. When I click again on the open button of the window it should not open the button again but instead switch to the window.
I do not know if I can do this, I saw some things about grab but I do not understand much if someone can help me thank you right away!
#-*- coding:UTF-8 -*-
from Tkinter import *
class novo:
def __init__(self, janela):
self.caixa=Frame(janela)
self.caixa.grid()
self.b=Button(janela, text='Abrir', command=self.new_jan)
self.b.grid()
self.l1=Label(janela, text='raiz!')
self.l1.grid()
def new_jan(self):
jan=Tk()
self.l=Label(jan, text='apenas fechando essa janela poderá voltar ou clicar na raiz!')
self.l.grid()
jan.geometry('300x200')
root=Tk()
novo(root)
root.geometry('300x200')
root.mainloop()
novo()