| 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 |
|
| 13 |
BEGIN { |
| 14 |
if (!eval q{ |
| 15 |
use Test::More; |
| 16 |
1; |
| 17 |
}) { |
| 18 |
print "1..0 # skip: no Test::More module\n"; |
| 19 |
exit; |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
plan tests => 4; |
| 24 |
|
| 25 |
if (!defined $ENV{BATCH}) { $ENV{BATCH} = 1 } |
| 26 |
|
| 27 |
use_ok("Tk::Adjuster"); |
| 28 |
|
| 29 |
my $mw = tkinit; |
| 30 |
$mw->geometry("+10+10"); |
| 31 |
|
| 32 |
{ |
| 33 |
my $f = $mw->Frame->pack(qw(-fill both -expand 1)); |
| 34 |
|
| 35 |
my $adj = $f->Adjuster; |
| 36 |
isa_ok($adj, "Tk::Adjuster"); |
| 37 |
|
| 38 |
$f->Label(-text => "top", -bg => "red")->pack; |
| 39 |
$adj->pack(-fill => "x"); |
| 40 |
$f->Label(-text => "bottom", -bg => "blue")->pack; |
| 41 |
|
| 42 |
pass("Adjuster packed"); |
| 43 |
} |
| 44 |
|
| 45 |
{ |
| 46 |
my $f = $mw->Frame->pack(qw(-fill both -expand 1)); |
| 47 |
$f->Label(-text => "top")->packAdjust; |
| 48 |
$f->Label(-text => "bottom")->pack; |
| 49 |
|
| 50 |
pass("packAdjust"); |
| 51 |
} |
| 52 |
|
| 53 |
if ($ENV{BATCH}) { |
| 54 |
$mw->after(300, sub { $mw->destroy }); |
| 55 |
} |
| 56 |
MainLoop; |
| 57 |
|
| 58 |
__END__ |