From: Georgios Petasis on
Hi all,

I want to display a transparent image in the middle of a Tk window.
Is this possible with Tk?

Right now I create a label with the image, and I place it in the middle
of the toplevel:


label .label -image HourglassWindow
place .label -anchor c -relx 0.5 -rely 0.5

But labels cannot have the {} background colour (as toplevels have), so
I get the default gray background:

http://www.ellogon.org/~petasis/tcl/Images/TransparentLabel.png

Any ideas?

George

From: Jeff Godfrey on
On 6/15/2010 4:43 AM, Georgios Petasis wrote:
> Hi all,
>
> I want to display a transparent image in the middle of a Tk window.
> Is this possible with Tk?
>
> Right now I create a label with the image, and I place it in the middle
> of the toplevel:
>
>
> label .label -image HourglassWindow
> place .label -anchor c -relx 0.5 -rely 0.5
>
> But labels cannot have the {} background colour (as toplevels have), so
> I get the default gray background:
>
> http://www.ellogon.org/~petasis/tcl/Images/TransparentLabel.png

Why not place the image in another toplevel and turn off the window
decorations?

Jeff

From: Uwe Klein on
Jeff Godfrey wrote:
> On 6/15/2010 4:43 AM, Georgios Petasis wrote:
>
>> Hi all,
>>
>> I want to display a transparent image in the middle of a Tk window.
>> Is this possible with Tk?
>>
>> Right now I create a label with the image, and I place it in the middle
>> of the toplevel:
>>
>>
>> label .label -image HourglassWindow
>> place .label -anchor c -relx 0.5 -rely 0.5
>>
>> But labels cannot have the {} background colour (as toplevels have), so
>> I get the default gray background:
>>
>> http://www.ellogon.org/~petasis/tcl/Images/TransparentLabel.png
>
>
> Why not place the image in another toplevel and turn off the window
> decorations?
>
> Jeff
>
There once was tktrans producing shaped transparency. it worked ( for me)

uwe
From: Jeff Godfrey on
On 6/15/2010 8:37 AM, Jeff Godfrey wrote:
> On 6/15/2010 4:43 AM, Georgios Petasis wrote:
>> Hi all,
>>
>> I want to display a transparent image in the middle of a Tk window.
>> Is this possible with Tk?
>>
>> Right now I create a label with the image, and I place it in the middle
>> of the toplevel:
>>
>>
>> label .label -image HourglassWindow
>> place .label -anchor c -relx 0.5 -rely 0.5
>>
>> But labels cannot have the {} background colour (as toplevels have), so
>> I get the default gray background:
>>
>> http://www.ellogon.org/~petasis/tcl/Images/TransparentLabel.png
>
> Why not place the image in another toplevel and turn off the window
> decorations?

I probably spoke too soon (I hadn't looked at your screen shot). I
thought you were looking for a rectangular, see-through image. Looking
at your screen shot, that's not the case...

Jeff

From: Uwe Klein on
Uwe Klein wrote:
> There once was tktrans producing shaped transparency. it worked ( for me)
>
> uwe
for windows:
http://wiki.tcl.tk/5764
for unix, windows?:
http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html
notice the comment further down:
"Tkdnd is the sort of extension that will find my work relevant and useful..."

I seem to have used "shape".

uwe