I'm trying to add a background to my Tkinter window, but when I use this code, then It opens the background as a different Tkinter window and the main window as a seperate one. How can I make them into one?
from tkinter import *
from tkinter.filedialog import askopenfilename
from tkinter import messagebox
top = Tk()
C = Canvas(top, bg ="blue", height=250, width=300)
filename = PhotoImage(file = "C:/Users/plapl/Desktop/ching.pgm")
background_label = Label(top, image=filename)
background_label.place(x=0, y=0, relwidth=1, relheight=1)
C.pack()
top.mainloop()
def newfile():
print("New File!")
root = Tk()
menu = Menu(root)
root.config(menu=menu)
filemenu = Menu(menu)
menu.add_cascade(label="File", menu=filemenu)
filemenu.add_command(label="New", command=newfile)
filemenu.add_separator()
filemenu.add_command(label="Exit", command=root.quit)
mainloop()