examples/canvastile
raw| 1 | #!/usr/local/bin/perl |
| 2 | use Tk; |
| 3 | use Tk::widgets qw(Canvas); |
| 4 | my $mw = MainWindow->new(); |
| 5 | my $tile = $mw->Photo(-file =>Tk->findINC('Camel.xpm')); |
| 6 | my $c = $mw->Canvas( |
| 7 | -background => 'yellow', |
| 8 | -width => 300, |
| 9 | -height => 250, |
| 10 | -relief => 'raised', |
| 11 | -borderwidth => 3, |
| 12 | # -tile => $tile, |
| 13 | -offset => [-30,-30], |
| 14 | )->pack; |
| 15 | |
| 16 | $c->createImage(30,30, -image => $tile); |
| 17 | |
| 18 | $c->update; |
| 19 | $c->after(1000); |
| 20 | $c->configure(-tile => $tile); |
| 21 | MainLoop; |