Debian Codegraph @

examples/iconimg

raw
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