Does that explain it?

Yes, it makes sense now, after playing with this. You say refreshed, I say reset/reinitialized.

#!/usr/bin/perl -- use strict; use warnings; use Tk; my %in = ( a => 4, # HEAVY b => 4, c => 4, d => 24, e => 24, f => 24, g => 1000, h => 150, i => 150, j => 150, k => 600, # hot air baloon ); my @ev11 = map {[$_, $in{$_}, 0, $in{$_}, undef ]} sort keys %in; my $mw = tkinit; my $fr = $mw->Frame( -background => 'red', )->pack;#( qw/ -expand x -f +ill x -anchor n -side top / ); $fr->Label( -text => 'NUMHITS:')->grid( qw/ -stick ew -row 1 -column 1 + /); $fr->Label( -text => 'letter(interval):')->grid( qw/ -stick ew -row 2 +-column 1 /); $fr->Label( -text => 'time remaining:')->grid( qw/ -stick ew -row 3 -c +olumn 1 /); my %butt; { #~ $one->[0] letter #~ $one->[1] interval #~ $one->[2] number hits #~ $one->[3] time remaining #~ $one->[4] button use constant INTERVAL => 1; use constant NUMHITS => 2; use constant TIMEREM => 3; use constant BUTTON => 4; my $col = 2; for my $one ( @ev11 ){ $fr->Label( -relief => 'groove', -text => $one->[0] . ' (' . $one->[1] . ')', )->grid( qw/ -sticky ew -row 2 /, -column => $col ); $fr->Label( -relief => 'groove', -textvariable => \$one->[NUMHITS] )->grid( qw/ -sticky ew -row 1 /, -column => $col ); $one->[BUTTON] = $fr->Button( -command => \&Fooo, -textvariable => \$one->[TIMEREM], )->grid( qw/ -sticky ew -row 3 /, -column => $col ); $col++; $butt{ $one->[BUTTON] } = $one; } } my $tx = $mw->ROText->pack(qw/ -expand 1 -fill both -anchor n -side to +p / ); MainLoop; sub Fooo { my $b = $Tk::event->W; $tx->insert( 'end', sprintf '%s(%d/%d), ', $butt{ $b }->[0] , $butt{ $b }->[NUMHITS] , $butt{ $b }->[TIMEREM], ); for my $one ( @ev11 ){ $one->[TIMEREM]--; $one->[BUTTON]->configure( qw/ -state normal /); } $butt{ $b }->[NUMHITS]++; $butt{ $b }->[TIMEREM] = $butt{ $b }->[INTERVAL]; $b->configure( qw/ -state disabled /) ; } __END__

a(0/4), b(0/3), c(0/2), a(1/2), b(1/2), c(1/2), d(0/18), a(2/1), b(2/1), c(2/1), e(0/14), a(3/1), b(3/1), c(3/1), f(0/10), a(4/1), b(4/1), c(4/1),

Looks like you could have four 4-second repeaters max without dropping one ( or five 4 second repeaters and nothing else).


In reply to Re^3: Time Allotments by Anonymous Monk
in thread Time Allotments by alanonymous

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.