Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: trying to use loops in perl gtk2

by Corion (Patriarch)
on Jan 05, 2015 at 13:37 UTC ( [id://1112192]=note: print w/replies, xml ) Need Help??


in reply to trying to use loops in perl gtk2

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);

Replies are listed 'Best First'.
Re^2: trying to use loops in perl gtk2
by Muskovitz (Scribe) on Jan 05, 2015 at 22:17 UTC
    thanks `Corion` thats what i need, very thanks! but i think
    my $num=0;
    is just a waste code! btw thanks again!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2024-04-23 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found