check for win32 libraries with Devel::CheckLib (too)
[imager-screenshot.git] / t / 40tkwin32.t
CommitLineData
b2239557
TC
1#!perl -w
2use strict;
3use Test::More;
4
5use Imager::Screenshot 'screenshot';
6
7Imager::Screenshot->have_win32
8 or plan skip_all => "No Win32 support";
9
10eval "use Tk;";
11$@
12 and plan skip_all => "Tk not available";
13
14my $im;
dcdbb706
TC
15my $mw;
16eval {
17 $mw = Tk::MainWindow->new;
18};
19$@ and plan skip_all => 'Cannot create a window in Tk';
b2239557 20
6d2b10ba
TC
21$mw->can('windowingsystem')
22 or plan skip_all => 'Cannot determine windowing system';
23
b2239557
TC
24$mw->windowingsystem eq 'win32'
25 or plan skip_all => 'Tk windowing system not Win32';
26
27plan tests => 1;
28
29$mw->Label(-text => "test: $0")->pack;
30$mw->after(100 =>
31 sub {
32 $im = screenshot(widget => $mw)
33 or print "# ", Imager->errstr, "\n";
34 $mw->destroy;
35 });
36MainLoop();
37ok($im, "grab from a Tk widget");
38