I yet again have some problem with Tkinter.

As you can see in the image, the labels are having a grey background by default. Now that i have a label set as background i'd like to have the gray gone from the text labels because of obvious reasons. How can i manage to get the background of labels transparent?
from Tkinter import *
# ***** Start of Gui *****
root = Tk()
root.title("Here could be your ad")
root.geometry("350x150")
root.minsize(350,150)
root.resizable(False, False)
# ***** Background *****
photo = PhotoImage(file="recycled.gif")
background_label = Label(root, image=photo)
background_label.place(x=0, y=0, relwidth=1, relheight=1)
background_label.image = photo
# ***** Text *****
l1 = Label(root, text="Here could be your ad")
l2 = Label(root, text="Here could be your ad")
l3 = Label(root, text="Here could be your ad")
l4 = Label(root, text="Here could be your ad")
l1.grid(row=0, sticky=W)
l2.grid(row=1, sticky=W)
l3.grid(row=2, sticky=W)
l4.grid(row=3, sticky=W)
# ***** Variables for Input *****
var0 = StringVar()
var1 = StringVar()
var2 = StringVar()
var3 = StringVar()
# ***** Input Boxes *****
e1 = Entry(root, textvariable=var0)
e2 = Entry(root, textvariable=var1)
e3 = Entry(root, textvariable=var2)
e4 = Entry(root, textvariable=var3)
e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
e3.grid(row=2, column=1)
e4.grid(row=3, column=1)
#Button
b = Button(root, text="Here could be your ad", bg='blue')
b.grid(row=4, column=1)
root.mainloop()
You can't. Labels don't support transparency.
The best solution is probably to use a canvas for the background, and use text objects instead of labels since text objects only draw the text and not the background.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With