I am pretty new to python and tkinter and have been creating an app that will show me today's information, such as weather and time. I have a background image created by a canvas, and I have text on a label on the canvas, but I do not know how to see the canvas through the label.
I have attached what I have now and what I would like to see (made in paint), as well as the code that I have right now.
I keep seeing the -alpha
widget and -transparentcolor
widget being used but this goes straight through to the applications behind my tkinter window. I havent found a way to make either of these work, but I might be missing something.
Any ideas?
The code:
from tkinter import *
from time import strftime
HEIGHT = 1080
WIDTH = 1920
def time():
clock = (strftime("%B"+" "+"%d"+" "+"%X"))
label.config(text=clock)
label.after(1000, time)
root = Tk()
root.title('App')
bg = PhotoImage(file="wallpaper.png")
canvas = Label(root, height=HEIGHT, width=WIDTH, image = bg)
canvas.pack()
label = Label(canvas, anchor='center', bg='black', fg='white',font=('Courier 45 bold'))
label.place(relx=0.05, rely=0.05, relwidth=0.4,relheight=0.2)
time()
root.mainloop()