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
11use strict;
12use FindBin;
13use lib $FindBin::RealBin;
14
15use Tk;
16use Tk::BrowseEntry;
17
18BEGIN {
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
28use TkTest qw(catch_grabs);
29
30plan tests => 1;
31
32if (!defined $ENV{BATCH}) { $ENV{BATCH} = 1 }
33
34my $mw = tkinit;
35$mw->geometry("+10+10");
36my $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;
45catch_grabs { $t->grab } 0;
46
47if ($ENV{BATCH}) {
48    $mw->after(500,sub{$mw->destroy});
49}
50
51MainLoop;
52
53ok(1);
54
55__END__
56