Charles Marcucci
Charles Marcucci

Reputation: 68

I can't open a windows in tkinter for an other

I have a problem with my GUI application with Tkinter. I don't understand why I can open another window. When name user and password are ok the connexion windows open a other windows but the windows never show

I think it's because I use two tk instances but It's work very fine this morning.

here some lines of codes for the connexion windows

# init the windows
global app
app = Connexion()
app.title("Se connecter")
app.mainloop()

# calling the other windows
Acceuil.appel_affichage_accueil(id_utilisateur)
global app
app.quit()

the init of the other windows

def appel_affichage_accueil(IDUtilisateurEnvoye):
    """
        On va afficher un message d'alerte dans la fenetre d'alerte
        la variable afficher correspont auIdUtilisateur message que l'on souhaite faire apparaitre
    """
    global Idutilisateur
    Idutilisateur = IDUtilisateurEnvoye
    AffichageAcceuil()

class AffichageAcceuil(tk.Tk):
    # ligne de code qui se lance lorsque de l'initialisation
    def __init__(self):
        tk.Tk.__init__(self)

Upvotes: 0

Views: 44

Answers (1)

Charles Marcucci
Charles Marcucci

Reputation: 68

Well I found the solution:

just replace app.quit() by app.destroy()

Upvotes: 1

Related Questions