GrandFather has asked for the wisdom of the Perl Monks concerning the following question:
I want to capture some option text as part of a script and thought that the following would do it:
use warnings; use strict; use Tk; my $main = MainWindow->new (-title => "Enter options"); my $text = $main->Text (); $text->pack(); MainLoop; my $options = join " ", $text->Contents (); print $options;
However the code fails at execution time (following exit from MainLoop) inside tk.pm, I presume trying to access $text, which I guess has been deleted.
Is there a light weight way of getting the text that has been entered into the Text widget $text?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grabbing Text widget's contents after MainLoop
by pg (Canon) on Jul 22, 2005 at 04:45 UTC | |
by GrandFather (Saint) on Jul 22, 2005 at 04:57 UTC | |
by pg (Canon) on Jul 22, 2005 at 05:11 UTC | |
by GrandFather (Saint) on Jul 22, 2005 at 05:16 UTC | |
|
Re: Grabbing Text widget's contents after MainLoop
by graff (Chancellor) on Jul 22, 2005 at 05:20 UTC | |
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 | |
|
Re: Grabbing Text widget's contents after MainLoop
by zentara (Cardinal) on Jul 22, 2005 at 12:14 UTC |