If I run this, and type in the text box, I only get a "Got: x" for the first letter I type, the rest of them seem to get ignored. In my real code, it doesnt seem to get called at all.use warnings; use strict; use Tk; my $MW = MainWindow->new(-title => "Tk::Text test", -width => 200, -height => 200); my $text = $MW->Text(-height => 10, -width => 40, -wrap => 'word'); $text->pack(-side => 'top', -fill => 'both'); $text->bind('<<Modified>>' => sub { getText($text, @_) } ); MainLoop; sub getText { my ($t, @args) = @_; my $text = $t->get('0.0', 'end'); print "Got: $text\n"; return if(!$text); return 1; }
I'm probably going to work around this by binding to <FocusOut> instead, but its still strange and annoying.. Or am I misinterpreting the docs?
C.
In reply to Using Tk::Text and '<<Modified>>' by castaway
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |