| 1 |
# -*- perl -*- |
| 2 |
BEGIN { $|=1; $^W=1; } |
| 3 |
use strict; |
| 4 |
use Test; |
| 5 |
use Tk; |
| 6 |
|
| 7 |
BEGIN { |
| 8 |
if ($Tk::platform eq 'MSWin32') { |
| 9 |
plan test => 1; |
| 10 |
} else { |
| 11 |
plan test => 7; #, todo => [1]; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
my $mw; |
| 16 |
$mw = Tk::MainWindow->new(); |
| 17 |
$mw->geometry('+10+10'); # This works for mwm and interactivePlacement |
| 18 |
|
| 19 |
if ($Tk::platform eq 'MSWin32') { |
| 20 |
my $curfile = "demos/demos/images/cursor.cur"; |
| 21 |
$mw->configure(-cursor => '@'.$curfile); |
| 22 |
$mw->update; |
| 23 |
ok($mw->cget(-cursor), '@'.$curfile); |
| 24 |
} else { |
| 25 |
$mw->configure(-cursor => ['@demos/demos/images/cursor.xbm','black']); |
| 26 |
$mw->update; |
| 27 |
$mw->after(200); |
| 28 |
my $ret = $mw->cget(-cursor); |
| 29 |
ok(ref($ret) eq 'ARRAY'); |
| 30 |
ok($ret->[0],'@demos/demos/images/cursor.xbm'); |
| 31 |
ok($ret->[1],'black'); |
| 32 |
eval { $mw->configure(-cursor => $ret) }; |
| 33 |
ok($@,''); |
| 34 |
my $tclcurspec = '@demos/demos/images/cursor.xbm blue'; |
| 35 |
$mw->configure(-cursor => $tclcurspec); |
| 36 |
$ret = $mw->cget(-cursor); |
| 37 |
ok(ref($ret) eq 'ARRAY'); |
| 38 |
ok($ret->[0],'@demos/demos/images/cursor.xbm'); |
| 39 |
ok($ret->[1],'blue'); |
| 40 |
} |
| 41 |
|
| 42 |
__END__ |