in reply to Grabbing Text widget's contents after MainLoop
I presume that while the Text widget is on the screen, you intend to type something into it, and you just want to see whatever was typed there printed to stdout on exit. Is that it? Then maybe something like this:
use strict; use Tk; my $main = MainWindow->new( -title => "Enter options:" ); my $text = $main->Text()->pack(); $main->Button(-text => "Done/Exit", -command => sub { print $text->Contents; exit(0) }, )->pack(); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Grabbing Text widget's contents after MainLoop
by GrandFather (Saint) on Jul 22, 2005 at 05:35 UTC | |
by graff (Chancellor) on Jul 22, 2005 at 05:51 UTC | |
by GrandFather (Saint) on Jul 22, 2005 at 09:20 UTC |