From: <har...@us...> - 2006-08-23 17:18:28
|
Revision: 4601 Author: hardaker Date: 2006-08-23 10:18:24 -0700 (Wed, 23 Aug 2006) ViewCVS: http://svn.sourceforge.net/net-policy/?rev=4601&view=rev Log Message: ----------- progress bar example Added Paths: ----------- trunk/net-policy/perl/QWizard/examples/progress_update.pl Added: trunk/net-policy/perl/QWizard/examples/progress_update.pl =================================================================== --- trunk/net-policy/perl/QWizard/examples/progress_update.pl (rev 0) +++ trunk/net-policy/perl/QWizard/examples/progress_update.pl 2006-08-23 17:18:24 UTC (rev 4601) @@ -0,0 +1,39 @@ +#!/usr/bin/perl + +# +# This is a simple (mostly) qwizard script that adds up a series of +# user entered numbers. It's primary purpose is to demonstrate how +# the -remap flag works for the add_todos function. +# + +use QWizard; +%primaries = + ( + + 'init_display' => { + title => 'Progress Bar Demonstration', + questions => [{ type => 'text', + check_value => \&qw_integer, + name => 'numsteps', + text => 'Enter the number of progress steps:', + help_desc => '(1 second between each step)', + }], + actions => [sub { + my ($qw) = @_; + my $steps = qwparam('numsteps'); + for (my $i = 0; $i < $steps ; $i++) { + print STDERR "sleeping $i/$steps\n"; + sleep(1); + $qw->set_progress(($i+1)/$steps); + } + }] + }, + ); + +my $qw = new QWizard(primaries => \%primaries, + title => 'Progress Bar Demonstrator', + no_confirm => 1); + +# $QWizard::qwdebug = 1; + +$qw->magic('init_display'); Property changes on: trunk/net-policy/perl/QWizard/examples/progress_update.pl ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |