6
eval { require Test; };
11
print STDERR "\n\tTest.pm module not installed.\n\tGrab it from CPAN.\n\t";
19
BEGIN { plan tests => 10 };
21
my $mw = Tk::MainWindow->new;
25
eval { require Tk::NumEntryPlain; };
26
ok($@, "", 'Problem loading Tk::NumEntryPlain');
27
eval { $nep = $mw->NumEntryPlain(); };
28
ok($@, "", 'Problem creating NumEntryPlain widget');
29
ok( Tk::Exists($nep) );
31
ok($@, "", '$text->grid problem');
32
eval { $nep->update; };
33
ok($@, "", '$nep->update problem');
36
## Check that -textvariable works for reading
37
## (set work but not supported)
41
my $e = $mw->NumEntryPlain(-textvariable=>\$num);
42
eval { $e->value(6); };
43
ok($@, "", 'Problem setting value');
44
ok($num, "6", "Textvariable is not updated");
47
ok($@, "", 'Problem in update after setting value');
51
## Check -increment, -bigincrement, -command and -browsecmd options
55
my $e = $mw->NumEntryPlain(-increment => 0.1,
57
-command => sub { $command++ },
58
-browsecmd => sub { $browsecmd++ },
60
ok($e->cget(-increment), 0.1);
61
ok($e->cget(-bigincrement), 50);
64
# XXX eventGenerate does not work
65
if ($Tk::VERSION < 800.017) {
66
skip("No -warp option for eventGenerate", 1) for (1..3);
71
$e->eventGenerate("<Motion>", '-x' => $x, '-y' => $y, -warp => 1);
72
$e->eventGenerate("<Up>");
75
$e->eventGenerate("<Return>",
76
'-x' => $x, '-y' => $y,