in reply to Re^2: Grabbing Text widget's contents after MainLoop
in thread Grabbing Text widget's contents after MainLoop
My original solution was sort of over kill, this one is much better and simpler:
use Tk; use Tk::DialogBox; my $mw = new MainWindow(); my $content; my $text = $mw->Text()->pack(); my $ok = $mw->Button(-text => "OK", -command => \&grab)->pack(); MainLoop; print $content; sub grab { $content = $text->Contents(); $mw->destroy(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Grabbing Text widget's contents after MainLoop
by GrandFather (Saint) on Jul 22, 2005 at 05:16 UTC |