In python, I can use a picture as a icon on a button in Tk() instance. But when I trying to use the picture in case of Toplevel(), it does not work. code:
from tkinter import *
root=Tk()
root.title("Login Window")
root.geometry("300x300")
def mainpage():
mp=Toplevel()
mp.title("Main Page")
new_img=PhotoImage(file="nen.png")
sea_img=PhotoImage(file="serch.png")
al_img=PhotoImage(file="shw.png")
Button(mp,image=new_img).pack(side="top",pady=0)
Label(mp,text="New Entry",bd=0).pack(side="top",padx=0,pady=0)
Button(mp,image=sea_img,bd=0,command=srch).pack(side="top")
Label(mp,text="Serach Record",bd=0).pack(side="top",padx=0,pady=0)
Button(mp,image=al_img,bd=0,command=al_rcrd).pack(side="top",pady=0)
Label(mp,text="All Record",bd=0).pack(side="top",padx=0,pady=0)
Label(root,text="User-Id",font=15).grid(row=0,column=0,padx=10,pady=10,sticky=W)
Entry(root).grid(row=0,column=1)
Button(root,text="Login",font=15,command=mainpage).grid(row=1,column=1,padx=10,pady=10)
root.mainloop()