in reply to Perl/TK Unpacking?
But watch out for memory gains if you place new frames in there. packForget dosn't destroy the widget, it just removes it from view. So reuse your frames and widgets.... by packForget'ing them, reconfiguring them in the withdrawn state, then repacking them. There are some details to work on, like unwanted resizing occurring, so you may need to repack the entire window. YMMV
#!/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__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl/TK Unpacking?
by mikasue (Friar) on Jul 18, 2006 at 19:15 UTC |