7
In my code there is a frame with a button and it is called "Open", when clicking "Open" another window will appear.
The problem is that if I click on the window that this "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 anyone. When I click the window open button again it should not open the button again but switch to the window.
I don’t know if you can do this, I saw some things about Grab but I don’t really understand if anyone can help me thank you from now on!
#-*- 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()
It would be nice if you could add to your questions, the code you already have and indicate through it what your doubt, it becomes easier for people to help you, as well as increase their interest in your question
– RodrigoBorth
Ready now I think you’ll understand!
– dhelbegor
I made an edit on your question, check if this is exactly what you are asking, because as you did not put points or line breaks it was difficult to understand
– RodrigoBorth
Let’s see how I can explain it better, think about the following frame called frame1, and a button that opens another frame that is called frame2, when it appears frame2 I want it to occur the following, not being able to select frame1 in any way until frame2 has been closed, I think it’s something like wait_window! anything I have Skype and I can show you what I really want through the remote. PS: Vlw same guy for striving to be able to help me!
– dhelbegor
I suggest you add this explanation to your question, edit it in a way that makes it clear, as you left with this comment... it is easier for those who know how to help
– RodrigoBorth
blz but I managed to solve my problem here I walked giving a studied and I managed to solve using Toplevel and Transient!
– dhelbegor
then as soon as you can, put your answer, explaining how you resolved, one’s doubt may be another’s doubt
– RodrigoBorth