Tcl-Tk

 view release on metacpan or  search on metacpan

tk-demos/widget_lib/transtile.pl  view on Meta::CPAN

use vars qw/$TOP/;

sub transtile {

    # Create a top-level window that demonstrates tiles
    # and transparent stuff.

    my($demo) = @_;
    $TOP = $MW->WidgetDemo(
        -name     => $demo,
        -text     => ['This window demonstrates tiles and transparent images. The Canvas has a yellow background, which displays for one second before it\'s overlayed with a tile of tiny camels. On top of the tile layer are three non-transparent imag...
        -title    => 'Tile and Transparent Demonstration',
        -iconname => 'transtile',
    );

    my $tile = $TOP->Photo(-file =>Tk->findINC('Camel.xpm'));

    # A tiled Canvas - the tile overlays the background color.

    my $c = $TOP->Canvas(
        -background  => 'yellow',
        -width       => 300,
        -height      => 250,
        -relief      => 'raised',
        -borderwidth => 3,
    )->grid;
    $c->update;
    $c->after(1000);

tk-demos/widget_lib/transtile.pl  view on Meta::CPAN


    # Transparently filled, with events.

    my $o3 = $c->createOval(25, 120, 100, 195,
        -outline => 'red',
        -fill    => 'blue',
        -stipple => 'transparent',
    );
    $c->bind($o3, '<Motion>' => $cb);

    # A transparent GIF overlaying everything.

    $c->createImage(300, 300,
        -image => $TOP->Photo(-data => &encoded_gif, -format => 'gif'),
	-anchor => 'se',
    );

} # end transtile

sub encoded_gif {



( run in 1.410 second using v1.01-cache-2.11-cpan-49f99fa48dc )