padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:
and the program is this one:bank1|ACTIVE bank2|NO ACTIVE bank3|ACTIVE
As you can see I choose to create averything from the textfile becasue we add or take out a bank, but if you run this program you will see that at the end, that it repeat itself again and again , so my question is how to stop the widget entry from duplicating itself?sub make_entry1 { my ($upframe,$labe2,$filename1) = @_; my $label_info4 = $upframe->Label( -text => 'Status :', )->pack(-side => 'left', -expand => 1); open(DAT1, $filename1) || die("Could not open file!"); my @stat1=<DAT1>; close(DAT1); foreach my $stat1(@stat1) { chomp ($stat1); my $operacion; my $stado1; ($operacion,$stado1)=split(/\|/,$stat1); my $label_display1 = $upframe->Label( -textvariable => \$operacion )->pack(-side => 'left', -expand => 1); if ($stado1 eq "ACTIVO"){ my $entry_info1 = $upframe->Entry( -foreground => 'blue', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left'); #-expand => 1); } else { my $entry_info1 = $upframe->Entry( -foreground => 'red', -textvariable => \$stado1, -width => 20, )->pack(-side => 'left'); #-expand => 1); } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with duplicate Entry in One frame
by pc88mxer (Vicar) on May 19, 2008 at 19:14 UTC | |
by padawan_linuxero (Scribe) on May 19, 2008 at 22:16 UTC | |
|
Re: Problem with duplicate Entry in One frame
by pc88mxer (Vicar) on May 19, 2008 at 22:36 UTC | |
by padawan_linuxero (Scribe) on May 20, 2008 at 20:14 UTC |