The "losing place" issue can be easily resolved by packing
the widget in a frame that remains packed, e.g.:
use strict;
use Tk;
my $onoff = 1;
my $mw = tkinit;
$mw->Label(-text => 'blah')->pack;
my $f = $mw->Frame->pack;
my $l = $f->Label(-text => 'blah2')->pack;
$mw->Label(-text => 'blah3')->pack;
$mw->Button(
-text => 'Toggle',
-command => [\&Toggle, $l],
)->pack;
MainLoop;
sub Toggle {
my($w) = @_;
if ($onoff) {
$w->packForget;
} else {
$w->pack;
}
$onoff = ! $onoff;
}
--
Go to http://MarcDashevsky.com to send me e-mail.
I agree, it would be very handy if their was a $widget->configure(-state =>
'hidden');
But that state is only allowed with items on a canvas ...
--
Dieter D'Hoker
news:free.nl.dieter.dhoker & news:alt.nl.fan.dieter.dhoker
Google? http://neverseenbefore.com/
Multiplayer tetris? http://www.tsrv.com/