×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Perl Progressbar

Perl Progressbar

Perl Progressbar

(OP)
Dear perl professionals,

  I have a problem in my perl code. I am trying to create progressbar which will be able to adapt its color according to specific decision i.e. if ($x<10)
$progress->configure(-colors=>[10,"green"])
      else
$progress->configure(-colors=>[10,"red"])

assume progressbar is already created with @colors=(0,'green') and -colors = \@colors

I am trying to run this code but it doesn't work. I will be thankful for your help

RE: Perl Progressbar

Hi

Perl standard distribution alone is not able to create progress bars.
In case you used a Perl module, please specify which.

By the way, in case you use the Tk module, your code works for me. Of course, after correcting the elementary Perl syntax errors.
 

Feherke.
http://feherke.github.com/

RE: Perl Progressbar

(OP)
I am using tk::progressbar and there's no compilation errors but the color of progressbar is not changed.

Here's example
@colors = (0,'green');
$progress = $mw->ProgressBar(
-width => 20,
-length => 200,
-colors => \@colors,
-variable => \$progress,
)->pack();


if ($x<10)
$progress->configure(-colors=>(0,'green',10,'red'));
else
$progress->configure(-colors=>(0,'green',10,'yellow'));

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close