It depends what you want to do. Do you want to completely obliterate the textbox object, or just hide it temporarily?
To obliterate completely, use $widget->destroy. To temporarily hide it, use $widget->packForget if using the pack geometry manager, or $widget->gridRemove for grid. To make it appear again, call the geometry manager again.
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ? (Missquoting Janis Joplin)
| [reply] |
I don't anything about Tk, but I managed to find this answer :
- "withdraw" removes toplevel widgets, including the root
window (it's documented under "Toplevel Window Methods,
Visibility Methods")
- To remove child widgets, use the geometry manager's "forget"
method ("pack_forget", "grid_forget", etc).
Hope this helps
| [reply] |
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
my $top = new MainWindow;
my $txt = $top->Scrolled("Text")->pack;
$top->Button(-text => "packForget",
-command => sub{
my @w = $top->packSlaves;
foreach (@w) { $_->packForget; }
})->pack();
$top->Button(-text => "Exit",
-command => sub {exit})->pack;
MainLoop;
__END__
I'm not really a human, but I play one on earth.
flash japh
| [reply] [d/l] |