~ubuntu-branches/ubuntu/maverick/perl-tk/maverick

« back to all changes in this revision

Viewing changes to image_test

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2010-05-30 09:19:40 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100530091940-wbmq9bloo92t9m6x
Tags: 1:804.029-1
* New Upstream Release (Closes: #578814).
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/local/bin/perl -w
2
 
 
3
 
use Tk;
4
 
 
5
 
 
6
 
$path = Tk->findINC("demos/images");
7
 
 
8
 
$top = MainWindow->new();
9
 
 
10
 
$bitmap = $top->Bitmap( '-file' => "$path/dir.icon",
11
 
                        '-maskfile' => "$path/dir.mask");
12
 
 
13
 
$photo  = $top->Photo( 'photo');
14
 
 
15
 
$pixmap = $top->Pixmap( 'quit' ,  '-file' => "$path/QuitPB.xpm");
16
 
 
17
 
$top->Label('-image'=> $bitmap)->pack;
18
 
$top->Label('-image'=> $photo  )->pack;
19
 
my $f = $top->Frame->pack;
20
 
$f->Button('-text' => 'PPM', '-command'
21
 
             => ['configure',$photo, -file => "$path/teapot.ppm" ] )->pack(-side => 'left');
22
 
$f->Button('-text' => 'GIF', '-command'
23
 
             => ['configure',$photo, -file => "$path/mickey.gif" ] )->pack(-side => 'left');
24
 
 
25
 
$f->Button('-text' => 'XBM', '-command'
26
 
             => ['configure',$photo, -file => "$path/face" ] )->pack(-side => 'left');
27
 
$f->Button('-text' => 'XPM', '-command'
28
 
             => ['configure',$photo, -file => "$path/QuitPBa.xpm" ] )->pack(-side => 'left');
29
 
$f->Button('-text' => 'Blank', '-command' => ['blank',$photo] )->pack;
30
 
$top->Button('-image'=> $pixmap, '-command'=>['destroy',$top] )->pack;
31
 
 
32
 
MainLoop;