Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Perl/Tk widget removal problem...

by bbfu (Curate)
on Aug 29, 2003 at 18:48 UTC ( [id://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;

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-18 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found