Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Re: Perl/Tk widget removal problem...

by bbfu (Curate)
on Aug 29, 2003 at 18:48 UTC ( #287796=note: print w/replies, xml ) Need Help??

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;

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.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://287796]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2022-11-28 06:12 GMT
Find Nodes?
    Voting Booth?