On 19/12/2011 4:00 AM, Josef Moellers wrote:
> Hi,
>
> I'd like to render a rectangle which should be partly transparent, i.e.
> whatever lies below the rectengle should gleam through the rectangle.
> I know of "-stipple => 'transparent'", but that just makes the rectangle
> completely transparent, but I'd rather have it 25% or so transparent.
>
> Josef
You are looking for the built-in bitmaps (gray10, gray25, gray50,
gray75). Here is a small script that shows it working. Move your mouse
over the red rectangle.
use Tk;
use strict;
my $mw = tkinit;
my $c = $mw->Canvas->pack;
$c->create('rectangle',0,0,100,100,-fill=>'blue');
$c->create('rectangle',50,50,150,150, -fill=>'red',
-activestipple=>'gray50');
MainLoop;
--Jack