Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: Rabie on May 23, 2022, 05:18:18 AM

Title: Python Tkinter Transparent Background
Post by: Rabie on May 23, 2022, 05:18:18 AM
Hi There,

i just wrote a simple Program that gives a transparent Window with python

Code: [Select]
from tkinter import Tk
import time
from tkinter import messagebox



root = Tk()
root.wait_visibility(root)
root.wm_attributes("-alpha", 0.6)
root.mainloop()

so with this Program i get an transparent Window on Ubuntu but not on TinyCore

is there any extension i need to install to get this to work on TinyCore 13.x/x86_64 ?

Thanx


Title: Re: Python Tkinter Transparent Background
Post by: Juanito on May 23, 2022, 05:34:32 AM
Is the tk8.6 extension loaded?
Title: Re: Python Tkinter Transparent Background
Post by: Rabie on May 23, 2022, 05:38:45 AM
Is the tk8.6 extension loaded?

yes
Title: Re: Python Tkinter Transparent Background
Post by: curaga on May 23, 2022, 07:33:52 AM
Alpha transparency? That needs a compositor. Normal X does not support it.
Title: Re: Python Tkinter Transparent Background
Post by: Rabie on May 24, 2022, 04:15:39 AM
Alpha transparency? That needs a compositor. Normal X does not support it.

that means there is no way to do it with X with some workaround ?
Title: Re: Python Tkinter Transparent Background
Post by: Juanito on May 24, 2022, 04:51:22 AM
You mention that things work on ubuntu - what is it using as a window manager?
Title: Re: Python Tkinter Transparent Background
Post by: Rabie on May 24, 2022, 06:24:26 AM
You mention that things work on ubuntu - what is it using as a window manager?

Code: [Select]
ls -l /etc/alternatives/ | grep -i window
lrwxrwxrwx 1 root root  15 Mai 17 12:26 x-window-manager -> /usr/bin/mutter
lrwxrwxrwx 1 root root  31 Mai 17 12:26 x-window-manager.1.gz -> /usr/share/man/man1/mutter.1.gz

Seems to be mutter
Title: Re: Python Tkinter Transparent Background
Post by: Juanito on May 24, 2022, 06:30:29 AM
I've used mutter in CorePure64 with gnome-session in both x11 and wayland modes, but never standalone - it should be possible, but I haven't tried.
Title: Re: Python Tkinter Transparent Background
Post by: curaga on May 24, 2022, 07:46:48 AM
that means there is no way to do it with X with some workaround ?
No, it means you need to install and run a compositor. Some WMs have a compositor built-in (like gnome or kde), some can work with an external compositor. There are several to choose from, not sure if any are packaged.
Title: Re: Python Tkinter Transparent Background
Post by: Rabie on May 26, 2022, 10:40:07 PM
thank you i will try that