Kafka has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks
I'm Binding to modified virtual event in Tk::Text and trying to get the text entered in the Text box.
Everything works as expected except when erasing with backspace or delete, then I get the text prior to erasing, is there a reason for this abnormality, or even a way to conclude what key was pressed and then I can evaluate the text on my own?
# Description entry my $tmp_frame = $frame->Frame()->grid(-column=>3,-row=>0,-sticky=> +'w'); my $tmp_desc = $tmp_frame->Scrolled('Text', -scrollbars=>'oe', -wrap=>'word', -height=>3, -width=>40, -borderwidth =>2, -background=>'white')->grid(); $tmp_desc->bind('<<Modified>>', sub { return if not $tmp_desc->editModified(); my $txt = $tmp_desc->get('1.0','end-1c'); print $txt; $tmp_desc->editModified('false'); return 1; });

Replies are listed 'Best First'.
Re: <<Modified>> Virtual event in Text
by Anonymous Monk on Jan 11, 2016 at 10:52 UTC
      I would consider this a bug
      Thanks a lot