From: Georgios Petasis on 15 Jun 2010 05:43 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 15 Jun 2010 09:37 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 15 Jun 2010 09:55 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 15 Jun 2010 10:07 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 15 Jun 2010 10:05
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 |