i have this program
class loginWindow():
def __init__(self, master):
self.master = master
self.frame = Frame(master)
master.title(u"Geometry Calc - Login")
Button(master, text="Login", command=self.login).pack()
def login(self):
self.newWindow = Toplevel(self.master)
main(self.newWindow)
self.master.withdraw()
class main():
def __init__(self, master):
# Nastavení nového okna
master.title(u"Geometry Calc") # Nadpis
master.geometry("695x935") # Rozmery v px
master.config(background="white")
master.resizable(width=FALSE, height=FALSE) # Zakážeme změnu rozměrů uživatelem - zatím..
menubar = Menu(master)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="Konec", command=master.quit)
menubar.add_cascade(label="Soubor", menu=helpmenu)
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="O programu", command=self.createAbout)
menubar.add_cascade(label="Pomoc", menu=helpmenu)
master.config(menu=menubar)
canvas = Canvas(master, width=691, height=900)
canvas.pack(expand=1, fill=BOTH)
self.showImage(canvas, 347, 454, "geometry_table.jpg")
root = Tk()
app = loginWindow(root)
root.mainloop()
`
and i have this problem. When i run my program, i can see login window, when i hit login button I get window main, but window login is only withdrawed. So when i close window main my program still run. And i need make this. First run program main, but will be invisible or something. And i see only login window (maybe Toplevel). When i hit button login the window loginWindow will get destroy() and the window main will be visible