1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!/usr/bin/perl -w
# -*- perl -*-
#
# $Id: browseentry-grabtest.t,v 1.3 2003/04/21 19:49:24 eserte Exp $
# Author: Slaven Rezic
#
# test whether grabs are correctly saved
use strict;
use FindBin;
use lib $FindBin::RealBin;
use Tk;
use Tk::BrowseEntry;
BEGIN {
if (!eval q{
use Test::More;
1;
}) {
print "1..0 # skip: no Test::More module\n";
exit;
}
}
use TkTest qw(catch_grabs);
plan tests => 1;
if (!defined $ENV{BATCH}) { $ENV{BATCH} = 1 }
my $mw = tkinit;
$mw->geometry("+10+10");
my $t = $mw->Toplevel;
$t->geometry("+20+20");
$mw->Label(-text => "disabled")->pack;
$mw->Entry->pack;
$t->BrowseEntry->pack;
$t->Button(-text => "OK",
-command => sub { $mw->destroy })->pack;
catch_grabs { $t->grab } 0;
if ($ENV{BATCH}) {
$mw->after(500,sub{$mw->destroy});
}
MainLoop;
ok(1);
__END__
|