in reply to Re: Perl-tk Entry
in thread Perl-tk Entry
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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl-tk Entry
by Limbic~Region (Chancellor) on Jul 16, 2008 at 23:28 UTC |