Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 34513
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: lamprecht [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 804.027
  • 804.027_500
  • 804.027_501
  • 804.028
Fixed in: (no value)



Subject: Tk::TextUndo
Tk::TextUndo does not adjust the x/yview to keep the insertion cursor visible in some cases. Test and patch attached.
Subject: TextUndo.t
use warnings; use strict; use Test::More; use Tk; use Tk::TextUndo; plan (tests => 1); my $mw = MainWindow->new(); my $frame = $mw->Frame()->pack(); my $text = $frame->Scrolled('TextUndo', -wrap => 'none', -width => 30, )->pack(); $text->focus; $mw->update; for (1..100){$text->eventGenerate('<KeyPress-x>')} $mw->update; ok(abs(${$text->xview}[1] - 1) < 0.01, 'Insertion cursor is visible at end of line');
Subject: TextUndo.patch
Index: TextUndo.pm =================================================================== --- TextUndo.pm (revision 11015) +++ TextUndo.pm (working copy) @@ -590,6 +590,7 @@ { $w->SUPER::insert($index,$char); $undo_item->[2] = $w->index('insert'); + $w->see('insert'); return; } }
On Fri Mar 28 19:55:39 2008, LAMPRECHT wrote: Show quoted text
> Tk::TextUndo does not adjust the x/yview to keep the insertion cursor > visible in some cases. Test and patch attached.
Does this happen also with stock Tk::Text? In this case the patch should probably go to Tk::Text's InsertKeypress method. Can you produce the problem only on Windows or also on Linux? Your test script runs fine on my system with an unmodified Tk 804.028 Regards, Slaven
Subject: Re: [rt.cpan.org #34513] Tk::TextUndo
Date: Sat, 13 Sep 2008 10:23:13 +0200
To: bug-Tk [...] rt.cpan.org
From: Ch Lamprecht <ch.l.ngre [...] online.de>
Slaven_Rezic via RT schrieb: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34513 > > > On Fri Mar 28 19:55:39 2008, LAMPRECHT wrote:
>> Tk::TextUndo does not adjust the x/yview to keep the insertion cursor >> visible in some cases. Test and patch attached.
> > Does this happen also with stock Tk::Text? In this case the patch should > probably go to Tk::Text's InsertKeypress method. > > Can you produce the problem only on Windows or also on Linux? Your test > script runs fine on my system with an unmodified Tk 804.028 > > Regards, > Slaven >
Hi Slaven, if the test passes, it's probably to a Problem with EventGenerate on some WMs. I tested on 804.028 Gnome/Metacity To reproduce the issue, you can do perl -MTk -e'tkinit->TextUndo(-wrap=>"none")->pack;MainLoop' and type past the end of the line (the right border of the window). I see the insertion cursor disappear. Compare to Tk::Text behaviour, where the view is adjusted and scrolls left to keep the insertion cursor visible: perl -MTk -e'tkinit->Text(-wrap=>"none")->pack;MainLoop' Cheers, Christoph
Yes, with Metacity the test script fails on my system. Thanks, patch applied and new test file inserted. See revision 11781 Regards, Slaven