Hello.
How can i set an image as a Tkinter window background? I mean the whole background of the window not a photo area.

This is an example code:

#!/usr/bin/env python3
# -*-coding: utf8-*-

from Tkinter import *

root = Tk()
photo = PhotoImage(file = "bg.gif")
w = Label(root, image=photo)
w.pack()

ent = Entry(root)
ent.pack()
ent.focus_set() 

root.mainloop()

With the code above; a window appears with an image background; but the entry box will be places out of that background, under the image. But i want the entry box to be places on the middle of the photo area.

We set the window background with this for example:

root.configure(background = 'AntiqueWhite1')

I want to set an image instead of a color.

This question has already been answered. Start a new discussion instead.