http://qs321.pair.com?node_id=287796


in reply to Perl/Tk widget removal problem...

Use gridForget() instead. You'll lose your configuration options, but it seems to work.

And some sample code, just because:

#!/usr/bin/winperl use warnings; use strict; use Tk; my $mw = MainWindow->new(); $mw->Label(-text => 'Do it')->grid(); my $btn; $btn = $mw->Button( -text => 'Click me', -command => sub { $btn->gridForget() }, )->grid(); MainLoop;

bbfu
Black flowers blossom
Fearless on my breath

Replies are listed 'Best First'.
Re: Re: Perl/Tk widget removal problem...
by jdtoronto (Prior) on Aug 29, 2003 at 19:19 UTC
    Thanks batkin and bbfu.

    Two valuable suggestions, thank you!

    I solved my problem by making the GUI look even cleaner, I put the upper part of the thing in a frame called $upp and the button in $lower, then I add to $upper as needed and the button stays below and gets re-configured every time.

    Just tested it, looks nice and works well with less code.

    jdtoronto