Subject: | character attributes not applied for inserted characters |
With the Tk::Text widget when tags are used to apply formatting
attributes to a span of characters, new characters inserted within the
span (using the keyboard) acquire the attributes of the character to the
left of the insertion point.
This behaviour is borken with Tk::TextUndo. Using the sample code, move
the insertion point to be within the span of struck out characters and
insert new characters using the keyboard. Notice that the new characters
are not struck out.
Edit the code to use Tk::Text instead and repeat the text. Notice that
the inserted characters are struck out when using the Text widget.
Subject: | noname.pl |
use strict;
use warnings;
use Tk;
#use Tk::TextUndo;
use Clipboard;
my $mw = MainWindow->new (-title => "PerlMonks node editor");
my $text = $mw->Scrolled
('Text', -font => 'normal', -wrap => 'word', -scrollbars => 'e',);
$text->pack (-expand => 'yes', -fill => 'both');
$text->tagConfigure ('_strike', -overstrike => 'on');
$text->insert ('end', "Some text to play with.\n", ['_strike']);
$text->insert ('end', "Some more text to play with.\n");
MainLoop ();