monkkazimir has asked for the wisdom of the Perl Monks concerning the following question:

All hail the wise PerlMonks!!!!

i was hoping you ppl could help me as i am trying to make a curses Application. inside the application i need to run a few other bash scripts and i need a progress bar for the duration of the script. so basically i press a button to execute then go into another widget screen which shows me progress of the bash script.

$w{7}->add( 'progressbarlabel', 'Label', -x => -1, -y => 3, -width => 10, -border => 1, -text => "the time" ); $w{7}->add( undef, 'Label', -text => "The progressbar can be used to provide some progress inf +ormation\n" . "to the user of a program. Progressbars can be drawn in s +everal\n" . "ways (see below for a couple of examples). In this example, +I\n" . "just built a kind of clock (the values for the bars are \n" . "depending upon the current time)." ); $w{7}->add( undef, "Label", -y => 7, -text => "Showing value"); $w{7}->add( 'p1', 'Progressbar', -x => 15, -y => 6, -showvalue => 1 ); sub progressbar_timer_callback($;) { my $cui = shift; my $COMMAND = "bash Script.sh $ARGUMENT1"; $w{7}->getobj('p1')->get(`$COMMAND`); } $cui->set_timer( 'progressbar_demo', \&progressbar_timer_callback, 1 ); $cui->disable_timer('progressbar_demo'); $w{7}->onFocus( sub{$cui->enable_timer ('progressbar_demo')} ); $w{7}->onBlur( sub{$cui->disable_timer ('progressbar_demo')} );
i also tried this:
$w{12}->add( undef, 'Buttonbox', -y => 7, -buttons => [ { -label => "< Example 1 >", -onpress => sub { $cui->progress( -min => 0, -max => 700, -title => 'Progress dialog without a message', -nomessage => 1, ); for my $pos (`bash RunAllTest-test.sh $EMAIL`) { $cui->setprogress($pos); } sleep 1; $cui->noprogress; } },{ -label => "< Example 2 >", -onpress => sub { my $msg = "Counting from 0 to 700...\n"; $cui->progress( -min => 0, -max => 700, -title => 'Progress dialog with a message', -message => $msg, ); for my $pos (0..700) { $cui->setprogress($pos, $msg . $pos . " / 700"); } $cui->setprogress(undef, "Finished counting!"); sleep 1; $cui->noprogress; } } ] );
i noticed that the scripts was being run for both the methods but i wasnt getting any progress bar whatsoever and i had my screen cluttered with error even though the scripts ran and were succesfully completed.

i noticed that the examples provided are based solely on numbers and scalar quantities because of which i have been stuck as to how to do this! any help will do!! thanks!!!