1

I'm having a trouble while implementing a log-in system in an interface I'm creating:

I want it to have two type of user: admin and user, so depending on what you choose you input your credentials and then if they're correct the system opens either the admin interface or the user interface.

My problem is that given the knowledge I have right now, I have to have a "mother window" while executing tkinter which is the first windows that opens when you run the program, in this case that mother window would be the log-in window, the thing is that if I close that log-in window once the user inputs his/her credentials, then the whole program doesn't work.

Is there a solution for this?

2
  • Share some executable code that can let us see the current behaviour of your script Commented Jan 14, 2020 at 15:08
  • You can use Frame as log-in form. If authentication succeeds, destroy the log-in frame and create another Frame based on the user type. All the frames are created inside the main window. Commented Jan 14, 2020 at 15:13

1 Answer 1

1

The simplest solution is to create two functions or two classes, one for the login window and one for the main window. Have these functions or classes return a single frame that contains everything needed for that part of the code.

Then, call the first function or class to login in, then destroy it and call the second function or class. When you destroy a frame, all of its children are also automatically destroyed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.