Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Semi transparent overlay

66 views
Skip to first unread message

P8j6

unread,
Jul 21, 2018, 1:42:51 PM7/21/18
to
Hi,

i need semi-transparent overlay for my program.

I created image with alpha transparency.

image create photo bg -file "bg.png" -format "png -alpha 0.5"

Now i need to place this image over my toplevel.

Something like this:

place .bg -x 0 -y 0


I tried:

ttk::label .overlay -image bg
place .overlay -x 0 -y 0

But it hides whole toplevel, because label is not transparent. Can i somehow make label transparent?

Or use another element to put image as overlay?

Arjen Markus

unread,
Jul 23, 2018, 3:55:19 AM7/23/18
to
One solution I can think of is to build your toplevel via a canvas. This does support both embedded widgets and transparent images.

Toplevel windows can be transparent as well, but that holds for the whole window area and is probably not what you are looking for. Although you could overlay your one toplevel window with a transparent other toplevel window (and do some trickery with move events to keep the relative position the same)

Regards,

Arjen
0 new messages