Re: Add text to desktop

Michael Lange <[email protected]>
Newsgroups gmane.comp.python.tkinter
Message-ID <[email protected]>
Hi,

On Thu, 26 May 2016 09:36:16 +0200
Paul Malherbe <[email protected]> wrote:

> You could use canvas to achieve this as per attached snippet.

with a few modifications, your example can be used to actually look like
a desktop wallpaper:

#####################################################
import Tkinter as tk
import ttk
from PIL import Image, ImageTk

root = tk.Tk()

w, h = root.winfo_screenwidth(), root.winfo_screenheight()
root.geometry('%dx%d+0+0' % (w, h))
root.wm_overrideredirect(1)
root.lower()

pilimg = Image.open("example.gif")
rimage = pilimg.resize((w, h), Image.ANTIALIAS)
fimage = ImageTk.PhotoImage(image=rimage)
cnv = tk.Canvas(root)
cnv.create_image(0, 0, image=fimage, anchor="nw", tags="img")
cnv.create_text(200, 100, text="HELLO BABY", font=("Arial", 20, "bold"))
cnv.pack(side="left", fill="both", expand="yes")
root.mainloop()
###################################################

However, as soon as you call something like "pcmanfm --desktop" to get
desktop icons your Tkinter "wallpaper" will be hidden underneath.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

I object to intellect without discipline;  I object to power without
constructive purpose.
		-- Spock, "The Squire of Gothos", stardate 2124.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.