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