in reply to Re: Perl Tk Naming Convention
in thread Perl Tk Naming Convention
becomesmy $frame1 = Tk::Frame->new; my $frame1_btn_ok = Tk::Button->new;
my %widget_hash; my $frame_count = 0; foreach my $count(1..10){ $widget_hash{$count}{ 'frame'} = $mw->Frame->new; $widget_hash{$count}{ 'ok_but'}= $widget_hash{$count}{ 'frame'}->Tk::Button->new; }
The advantages of doing that way, is that you can easily use a variable in your hash strings, rather than trying to concantate strings into strings
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl Tk Naming Convention
by arkturuz (Curate) on Jan 13, 2010 at 15:57 UTC |