~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to PNG/t/crash.t

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
# -*- perl -*-
 
3
 
 
4
#
 
5
# $Id: $
 
6
# Author: Slaven Rezic
 
7
#
 
8
 
 
9
use strict;
 
10
 
 
11
use Tk;
 
12
use Tk::PNG;
 
13
use FindBin;
 
14
 
 
15
BEGIN {
 
16
    if (!eval q{
 
17
        use Test::More;
 
18
        1;
 
19
    }) {
 
20
        print "1..0 # skip: no Test::More module\n";
 
21
        exit;
 
22
    }
 
23
}
 
24
 
 
25
plan tests => 1;
 
26
 
 
27
my $mw = tkinit;
 
28
$mw->packPropagate(0);
 
29
my $file = "$FindBin::RealBin/../pngtest.png";
 
30
my $img = $mw->Photo(-file => $file);
 
31
$mw->Label(-image => $img)->pack;
 
32
$mw->afterIdle
 
33
    (sub {
 
34
         $mw->GeometryRequest($img->width, $img->height);
 
35
         $mw->after(100,
 
36
                    sub {
 
37
                        $mw->GeometryRequest($img->width-20, $img->height-20);
 
38
                        $mw->after(100,
 
39
                                   sub {
 
40
                                       $mw->destroy;
 
41
                                   }
 
42
                                  );
 
43
                    }
 
44
                   );
 
45
     });
 
46
MainLoop;
 
47
 
 
48
pass("No crash while resizing a window with PNG image");
 
49
 
 
50
__END__