0

Hi!
I'am trying to make a program that dispalys a label with a image, but the rest of the program is "invisible", The problem I got is when I set the opacity, it affects the whole frame. This was ofcourse excepted, but I have not yet been able to make it ignore the label.
Here is the code:

from Tkinter import *

root = Tk()
root.wm_attributes('-alpha', 0.0)

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


root.mainloop()
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by vegaseat
0

If you simply don't want to show the Tkinter window title and border, you can use this ...

from Tkinter import *

root = Tk()
#root.wm_attributes('-alpha', 0.0)
root.overrideredirect(1)

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

root.mainloop()

Now you have to provide a way to exit, like binding a double-click on the image to quit().

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.