Well, the problem isnt that its not working. Its the gfx that aint updating _while_ working! Code is something like this: :)
$mw->Label(-text => "Path:")-> grid( -row => 0, -column => 0, -sticky => 'w'); my $pathEntry = $mw->Entry(-width => 50, -textvariable => \$fu +ll_path)-> grid( -row => 0, -column => 1, -sticky => 'w'); $mw->Button(-text => "Browse...", -command => sub {print $full +_path})-> grid( -row => 0, -column => 2, -sticky => 'n'); $mw->Button(-text => "Add/Update!", -command => [\&addUpdateBu +ttonPressed])-> grid( -row => 1, -column => 1, #-columnspan => 3, -sticky => 'n'); $mw->Label(-text => "Progress:")-> grid( -row => 2, -column => 0, -sticky => 'w'); $progressLabel = $mw->Label(-text => "0 / Unknown")-> grid( -row => 2, -column => 1, -sticky => 'n'); my $variable = 24; $progressBar = $mw->ProgressBar( -width => 16, -length => 400, -anchor => 'w', -from => 0, #-to => 100, -blocks => 10, -gap => 0, -colors => [0, 'green', 50, 'yellow' , 80, 'red'], -variable => \$statics{'files'} )-> grid( -row => 3, -column => 0, -columnspan => 3, -sticky => 'n'); &centerWindow($mw, 410, 100); $pathEntry->focus; MainLoop; sub addUpdateButtonPressed { print "Getting statics from: " . $full_path . " ...\n"; my $total_files = &countFilesTotally($full_path); print "Files found: " . $total_files . "\n"; $statics{'files'} = 0; $progressLabel->configure(-text => "0 / " . $total_files); $progressBar->configure(-to => $total_files); $progressBar->repeat(500, sub {$progressBar->update}); #threads->create("recursive", $full_path); &recursive($full_path); } sub recursive { my $dir = shift; .. do alot of stuff ... }

In reply to Re^2: Updating the Tk::ProgressBar live by Ace128
in thread Updating the Tk::ProgressBar live by Ace128

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.