in reply to Re^2: Using Tk::Text and '<<Modified>>'
in thread Using Tk::Text and '<<Modified>>'
"a consistent interface for all the Tk:: modules."
What is inconsistent here? I agree that it would be much better if they can add some examples here and there in Tk documents, so that we can reach the proper use more quickly. The entire Tk document is long but poor.
But your issue really does not point me to anything that is "inconsistent", but rather some sort of learning curve.
If you want me to point out the inconsistancy, I would say that they better support editModified() in widgets that are really similar to Tk::Text, for example Tk::Entry, but it does not.
use Tk; use Tk::Dialog; use warnings; use strict; my $MW = MainWindow->new(-title => "Tk::Text test", -width => 200, -height => 200); my $text = $MW->Entry( -width => 40); $text->pack(-side => 'top', -fill => 'both'); $text->bind( '<FocusOut>' => \&callback); my $text2 = $MW->Text(-height => 10, -width => 40, -wrap => 'word'); $text2->pack(-side => 'top', -fill => 'both'); MainLoop; sub callback { if ($text->editModified()) { $text->Dialog(-title=>"Modified",-text=>"\$text has been modif +ied")->Show();#or whatever you want $text->editModified(0); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Using Tk::Text and '<<Modified>>'
by castaway (Parson) on Nov 20, 2004 at 19:28 UTC |