| 1 |
use warnings; |
| 2 |
use strict; |
| 3 |
use Test::More; |
| 4 |
use Tk; |
| 5 |
|
| 6 |
plan (tests => 4); |
| 7 |
|
| 8 |
use_ok 'Tk::TextUndo'; |
| 9 |
|
| 10 |
my $mw = MainWindow->new(); |
| 11 |
$mw->geometry("+10+10"); |
| 12 |
|
| 13 |
my $frame = $mw->Frame()->pack(); |
| 14 |
|
| 15 |
my $text = $frame->Scrolled('TextUndo', |
| 16 |
-wrap => 'none', |
| 17 |
-width => 30, |
| 18 |
)->pack(); |
| 19 |
my $real_text = $text->Subwidget("scrolled"); |
| 20 |
isa_ok($real_text, "Tk::TextUndo"); |
| 21 |
isa_ok($real_text, "Tk::Text"); |
| 22 |
|
| 23 |
$text->focus; |
| 24 |
$mw->update; |
| 25 |
for (1..100){$text->eventGenerate('<KeyPress-x>')} |
| 26 |
$mw->update; |
| 27 |
# The failure can be reproduced with Tk804.028+Metacity, but not with fvwm2 |
| 28 |
ok(abs(${$text->xview}[1] - 1) < 0.01, 'Insertion cursor is visible at end of line'); |