3

I want to make some portion of a tkinter window transparent. I have successfully achieved it in windows and mac os using the following methods:

In windows:

root.attributes("-transparentcolor", '#000001')
root.config(bg="#000001")

In mac:

root.attributes("-transparent", True)
root.config(bg="systemTransparent") 

But I can't find any solution for linux, none of the above methods are working in linux (Ubuntu) because it doesn't have any tranparent attribute. Moreover, I don't want to use -alpha attribute because it makes the whole window transparent (including the widgets). What I want is full transparency in the background and other widgets to be visible/opaque.

Here is an image example (in windows and mac):

Tkinter UI in windows Tkinter UI in macos

Is this possible in linux?

Akascape
  • 219
  • 2
  • 11
  • I don't think `tkinter` has any support for that on Linux. You might have to do some magic with `libx11` using `ctypes` but that will be long and complicated and might have other side effects. – TheLizzard Feb 28 '23 at 17:52
  • yeah, libx11 will be way too complicated. I know about windll a bit, but no experience with libx11. – Akascape Feb 28 '23 at 18:33

0 Answers0