2
I’m creating a system with a few screens, Every time I click on the button to call the screen it creates a new instance of the same screen, so if the user keeps clicking on the same button several new screens will be created equal. I want that when opening a screen can only open another of the same if the first is closed.
Follows Code:
from tkinter import *
import time
#MENU PRINCIPAL DO SISTEMA
janelamenu = Tk()
def janela_criar_usuario():
janelacriarusuario = Tk()
janelacriarusuario.geometry("600x600+250+50")
#janelacriarusuario.mainloop()
def janela_edit_usuario():
janelaeditusuario = Tk()
janelaeditusuario.geometry("600x600+250+50")
janelaeditusuario.mainloop()
menu_bt_criar = Button(janelamenu, text='Criar Usuario',command=janela_criar_usuario)
menu_bt_edituser = Button(janelamenu, text='Editar Usuario',command=janela_edit_usuario)
menu_bt_criar.place(x=30,y=100)
menu_bt_edituser.place(x=30,y=130)
janelamenu.geometry("200x600+50+50")
janelamenu.title("Menu Principal")
janelamenu.mainloop()
Great solution! I managed to solve my problem, thank you very much!
– Jose Correia Lins Neto
I’m glad my answer helped you. Hug and see you next time!
– Éder Garcia