Well, below is the example from the k::Progress bar.
Now, it’s NOT blatantly obvious on to how to get this code to work in conjunction with the Dirtree so that if a large drive was selected then the progress bar will indicate that the script is obtaining information and the progress bar will disappear once the data is ready to be displayed.
Is there simpler example for a slow monk like me please?
use strict; use Tk; use Tk::ProgressBar; use Tk::Scale; my $mw = MainWindow->new; my $status_var = 0; my($fromv,$tov) = (0,100); foreach my $loop (0..1) { my $res = 0; my $blks = 10; my @p = qw(top bottom left right); foreach my $dir (qw(e)) { $mw->ProgressBar( -borderwidth => 2, -relief => 'sunken', -width => 20, -padx => 2, -pady => 2, -variable => \$status_var, -colors => [0 => 'green', 50 => 'yellow' , 80 => 'red'], -resolution => $res, -blocks => $blks, -anchor => $dir, -from => $fromv, -to => $tov )->pack( -padx => 10, -pady => 10, -side => pop(@p), -fill => 'both', -expand => 1 ); $blks = abs($blks - ($res * 2)); $res = abs(5 - $res); } ($fromv,$tov) = ($tov,$fromv); } $mw->Scale(-from => 0, -to => 100, -variable => \$status_var)->pack; MainLoop;

In reply to Re: (bbfu) Re: simple Perl/Tk problems by blackadder
in thread simple Perl/Tk problems by blackadder

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.