amdme127 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to create a Perl program (Perl Tk GUI) that runs different scripts based on what users choose out of a menu at the top. The scripts output text progress and feedback based on records that the script processed into a Scrolled widget/element. I want to be able to forget/destroy/delete the widget when I move to a new option in the menu so I can create a fresh one to output text from the next script the user will run.
my $mainFrame = $mw->Frame()->pack(-side=>'top'); my $tx = $mainFrame->Scrolled(qw/Text -font normal -width 73 -height 15 -wrap word -scrollbars e/); $tx->pack; tie *STDOUT, 'Tk::Text', $tx; #script is called, runs, outputs to Scrolled above, user chooses new o +ption and sub clear() is called: sub clear{ $mainFrame ->destroy(); $tx ->pack('forget'); }
I want the $tx widget to disappear/clear off the screen
I have tried multiple things like forget, destroy, delete and anything else I could find on this site and around the interwebs. Some of them don't throw errors at all, but when I go to run a different script, the Scrolled widget/element will not clear from the screen so the new one shows up below the old one. I am relatively new to Perl GUI programming (this is my first GUI with Perl and I am trying to learn it as I go) so go easy on me
</code>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Tk Forgetting a Widget
by zentara (Cardinal) on Oct 14, 2011 at 12:54 UTC | |
by keszler (Priest) on Oct 15, 2011 at 15:28 UTC | |
by zentara (Cardinal) on Oct 16, 2011 at 13:39 UTC | |
by keszler (Priest) on Oct 17, 2011 at 04:23 UTC | |
|
Re: Perl Tk Forgetting a Widget
by Khen1950fx (Canon) on Oct 14, 2011 at 03:04 UTC | |
|
Re: Perl Tk Forgetting a Widget
by priyaviswam (Sexton) on Oct 14, 2011 at 07:31 UTC |