You only create one $label outside of the loop. If you want to create five labels, you need to put the label creation into the loop:
... my $vbox1=Gtk2::VBox->new; for my $num (1 .. 5){ my $label=Gtk2::Label->new("Total Count: $num"); $vbox1->add($label); } $window->add($vbox1);
In reply to Re: trying to use loops in perl gtk2
by Corion
in thread trying to use loops in perl gtk2
by Muskovitz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |