If you'll run it you'll see that each time you turn it on new entry appears but when you turn it off, it doesnt disappear. Thanks again!use strict; use Tk; my $main = MainWindow->new; $main->minsize(qw(350 350)); $main->title("GUI"); $main->configure(); my $left3 = $main->Frame()->pack(-side=>'left'); my $padchk=0; if ($padchk==1) {$padchk=1;} else {$padchk=0;} my $padchk = $left3->Checkbutton(-variable=>\$padchk,-command=> sub{op +en_menu($padchk)})->pack(); MainLoop; sub open_menu { my $padchk= shift; my $gdsPath= shift; my $text=$left3->Label(-text=> 'enter your name:', -background=>'white +'); my $gdsPath=$left3->Entry(); if ($padchk==1){ $text->pack(); $gdsPath->pack(); } elsif ($padchk==0){ $text->destroy; $gdsPath->destroy; $left3->update; } }
In reply to Re^2: Perl-tk Entry
by erez_ez
in thread Perl-tk Entry
by erez_ez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |