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

« back to all changes in this revision

Viewing changes to examples/iconimg

  • 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
my $top = MainWindow->new();
 
6
$top->title("Mail : Trial");
 
7
 
 
8
my $i64 = $top->Photo(-width => 64, -height => 64, -gamma => 2, '-file' => Tk->findINC("Xcamel.gif"));
 
9
my $i32 = $top->Photo(-width => 32, -height => 32);
 
10
$i32->copy($i64,-subsample => 2,2);
 
11
my $i16 = $top->Photo(-width => 16, -height => 16);
 
12
$i16->copy($i64,-subsample => 4,4);
 
13
my $w = $i64->width;
 
14
my $h = $i64->height;
 
15
 
 
16
 
 
17
$top->Button(-bitmap => 'Tk', -command => sub {
 
18
$top->withdraw;
 
19
$top->iconbitmap('Tk');
 
20
$top->deiconify})->pack;
 
21
 
 
22
foreach my $img ($i64,$i32,$i16)
 
23
 {
 
24
  $top->Button(-image => $img, -command => sub {
 
25
  $top->withdraw;
 
26
  $top->iconimage($img);
 
27
  $top->deiconify})->pack;
 
28
 }
 
29
 
 
30
MainLoop();
 
31
 
 
32