Eradicatore has asked for the wisdom of the Perl Monks concerning the following question:
#!/bin/perl use Tk; use Tk::Checkbutton; use Tk::Button; use File::Basename; ### Globals $version=0.10; $num_tasks=100; $max_timeout=60; ################# START OF CODE ################## my $mw=MainWindow->new; $mw->title("my app: Version $version"); $mw->Label(-text=>"something\n\n")->pack; my $mf = $mw->fontCreate('tiny', -family=>'arial', -size=>int(1)); $main_data_f = $mw->Frame(-background=>'red')->pack(-anchor=>'w'); foreach $i (1..$num_tasks) { $main_data_task_f[$i] = $main_data_f->Frame()->pack(-side=>'left'); foreach $j (1..$max_timeout) { #next if ($j>$i); if ($j%2) { if ($i%2) { $test_bg = 'red'; } else { $test_bg = 'blue'; } } else { if ($i%2) { $test_bg = 'blue'; } else { $test_bg = 'red'; } } if ($cnt++>3880) {$test_bg = 'yellow'}; $main_data_time_f[$i][$j] = $main_data_task_f[$i]->Frame()->pac +k(-side=>'bottom'); $box[$i][$j] = $main_data_time_f[$i][$j]->Label(-font=>$mf, -ba +ckground=>$test_bg)->pack(); } } MainLoop;
Justin Eltoft
"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is there some limit to the max num of widgets in perl tk?
by zentara (Cardinal) on Nov 21, 2007 at 12:36 UTC | |
|
Re: Is there some limit to the max num of widgets in perl tk?
by perlfan (Parson) on Nov 21, 2007 at 05:49 UTC | |
by Eradicatore (Monk) on Nov 21, 2007 at 06:47 UTC | |
by Eradicatore (Monk) on Nov 21, 2007 at 07:07 UTC | |
by strat (Canon) on Nov 21, 2007 at 07:36 UTC | |
by Anonymous Monk on Nov 21, 2007 at 09:08 UTC | |
by roboticus (Chancellor) on Nov 21, 2007 at 14:28 UTC |