Hi i am new to python tkinter programing.I am trying to close current window.But when,I click quit all the windows including the main are quitting. I am using currrentwindow.destory(),but it's closing all .
def dic_winn3():
DicWin = tk.Toplevel(root)
DicWin.title('operations')
DicWin.geometry('300x300')
DicWinButton.config(state='normal')
L1 = Label(DicWin, text="country")
L1.pack()
E1 = Entry(DicWin, bd =20)
E1.pack()
L2 = Label(DicWin, text="phone")
L2.pack()
E2 = Entry(DicWin, bd =20)
E2.pack()
L3 = Label(DicWin, text="customerid")
L3.pack()
E3 = Entry(DicWin, bd =20)
E3.pack()
L4 = Label(DicWin, text="address")
L4.pack()
E4 = Entry(DicWin, bd =20)
E4.pack()
L5 = Label(DicWin, text="contact name")
L5.pack()
E5 = Entry(DicWin, bd =20)
E5.pack()
B3 = tk.Button(DicWin, text='quit', command=close_window)
B3.pack()
def dic_winn4():
DicWin = tk.Toplevel(root)
DicWin.title('operations')
DicWin.geometry('300x300')
DicWinButton.config(state='normal')
L1 = Label(DicWin, text="productid")
L1.pack()
E1 = Entry(DicWin, bd =20)
E1.pack()
L2 = Label(DicWin, text="orderid")
L2.pack()
E2 = Entry(DicWin, bd =20)
E2.pack()
L3 = Label(DicWin, text="quantity")
L3.pack()
E3 = Entry(DicWin, bd =20)
E3.pack()
B4 = tk.Button(DicWin, text='quit', command=close_window)
B4.pack()
def dic_winn5():
DicWin = tk.Toplevel(root)
DicWin.title('operations')
DicWin.geometry('300x300')
DicWinButton.config(state='normal')
L1 = Label(DicWin, text="unitprice")
L1.pack()
E1 = Entry(DicWin, bd =20)
E1.pack()
L2 = Label(DicWin, text="units in stock")
L2.pack()
E2 = Entry(DicWin, bd =20)
E2.pack()
L3 = Label(DicWin, text="product name")
L3.pack()
E3 = Entry(DicWin, bd =20)
E3.pack()
L4 = Label(DicWin, text="product id")
L4.pack()
E4 = Entry(DicWin, bd =20)
E4.pack()
B5 = tk.Button(DicWin, text='quit', command=close_window)
B5.pack()
def dic_winn6():
DicWin = tk.Toplevel(root)
DicWin.title('operations')
DicWin.geometry('300x300')
DicWinButton.config(state='normal')
L1 = Label(DicWin, text="supplierid")
L1.pack()
E1 = Entry(DicWin, bd =20)
E1.pack()
L2 = Label(DicWin, text="company name")
L2.pack()
E2 = Entry(DicWin, bd =20)
E2.pack()
B6 = tk.Button(DicWin, text='quit', command=close_window)
B6.pack()
#def quit_win():
#DicWin.destroy()
#DicWinButton.config(state='normal')
def close_window ():
root.destroy()
#def close_window1 ():
#DicWin1.destroy()
QuitButton = tk.Button(root, text='Quit', command=close_window)
QuitButton.pack()
#button = tk.Button (root, text = "Good-bye.", command = close_window)
#button.pack()
DicWinButton = tk.Button(root, text='insert', command=dic_win)
DicWinButton.pack()
DicWinButton = tk.Button(root, text='update', command=dic_win)
DicWinButton.pack()
DicWinButton = tk.Button(root, text='delete', command=dic_win)
DicWinButton.pack()
root.mainloop()
Thanks for the help in advance.