in reply to Using Tk::Text and '<<Modified>>'
#!/usr/bin/perl use warnings; use strict; use Tk; use Tk::Text; 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, @_ ); } ); $MW->Button(-text=>'Clear Modified Flag', -command => sub{ $text->editModified(0) } )->pack(); MainLoop; sub getText { my ( $t, @args ) = @_; my $text = $t->get( '0.0', 'end' ); print "Got: $text\n"; return if ( !$text ); return 1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Tk::Text and '<<Modified>>'
by Courage (Parson) on Nov 20, 2004 at 15:44 UTC | |
|
Re^2: Using Tk::Text and '<<Modified>>'
by castaway (Parson) on Nov 20, 2004 at 16:08 UTC | |
by pg (Canon) on Nov 20, 2004 at 18:35 UTC | |
by castaway (Parson) on Nov 20, 2004 at 19:28 UTC |