I wanted to create a GUI with Tkinter in Linux (Python3.x). When I tried to execute the following: -
from tkinter import *
import tkinter
root = Tk()
root.overrideredirect(True) # Hide the cross button and that bar
root.wait_visibility(root)
root.call("wm", "attributes", ".", "-transparent", "true")
root_w = 190
root_h = 190
win_w = root.winfo_screenwidth()
win_h = root.winfo_screenheight()
root.geometry(f'{root_w}x{root_h}+{win_w - root_w - 40}+{win_h - root_h - 40}')
samplabl = Button(root, text=f"WIDTH: {win_w} HEIGHT: {win_h}", bg='#ffffff')
samplabl.pack()
root.mainloop()
This is what I get: -
Traceback (most recent call last):
File "/home/bravo6/Desktop/Stella__Compilative/GUI/temp.py", line 8, in <module>
root.call("wm", "attributes", ".", "-transparent", "true")
_tkinter.TclError: bad attribute "-transparent": must be -alpha, -topmost, -zoomed, -fullscreen, or -type
Looks like the wm_attribute didn't recognise the -transparent attribute... It seemed that it only works in Windows. Any idea how to get this working in Linux?