Mint Tkinter transparent window window
I am trying to use a transparent background using Tkinter:
from Tkinter import *
root = Tk()
root.attributes('-alpha', 0.1)
#~ root.wm_attributes('-alpha', 0.1)
#~ root.wm_attributes("-transparentcolor", "white")
#~ root.attributes("-fullscreen",True)
root.mainloop()
This code works fine on Windows, but doesn't use Linux Mint Maya. Other options I've tried are commented out. Any suggestions what could be wrong?
source to share
Just setting root.attributes('-alpha', 0.1)
does nothing for me as well as in Linux, even after taking down / restoring the window. However, for a reason unknown to me, if you change the type first root
(even by setting it to "normal"), then the window becomes transparent:
from Tkinter import *
root = Tk()
root.attributes('-type', 'normal')
root.attributes('-alpha', 0.1)
root.mainloop()
'- type' is only an X11 attribute.
As with your other attempts, attributes
and wm_attributes
are the same function, so it makes sense that your attempt with help root.wm_attributes('-alpha', 0.1)
didn't work either. Also, according to the tcl / tk documentation, '-transparentcolor' is only a Windows attribute, so it doesn't work on Linux.
source to share