I have been developing a tkinter project and I have run into a problem where I have two windows open when the button widget is clicked instead of just a singular window frame. There isn't any specific syntactic error with my code, I was just hoping someone could point me in the right direction for structuring my small GUI program correctly.
I would be really appreciate any support even if it was just an example code or a link.
Thanks.
Welcome Page
from tkinter import *
from from External_Menu import *
root = Tk()
root.state('zoomed')
root.title("Leisure Centre")
title = Label(root, text="Leisure Centre", font=("", 26))
title.place(relx=0.5, rely=0.0, anchor=N)
welcome = Button(root, text="Welcome!", font=("", 18), command=menu)
welcome.place(relx=0.5, rely=0.5, anchor=CENTER)
root.mainloop()`
External_Menu
from tkinter import *
def menu():
root = Tk()
root.state('zoomed')
external_menu_lbl = Label(root, text="External Menu", font=("", 26))
external_menu_lbl.pack()
sign_in_button = Button(root, text="Sign In", command=login_page)
sign_in_button.pack()
sign_up_button = Button(root, text="Sign Up", command=sign_up_page)
sign_up_button.pack()
root.mainloop()