Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /lib64/perl5/vendor_perl/Prima/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/perl5/vendor_perl/Prima/examples/progressbar.pl
use strict;
use warnings;
use Prima qw(Application Sliders);

=pod

=head1 NAME

examples/progressbar.pl - display progress bars

=cut

my $w = Prima::MainWindow->new(
	text => 'Progress bars',
	onKeyDown => sub {
		my ( $self, $code, $key, $mod ) = @_;
		if ( $key == kb::Left ) {
			my $v = $self->P1->value;
			$self->$_->value($v - 5) for qw(P1 P2 P3);
		}
		if ( $key == kb::Right ) {
			my $v = $self->P1->value;
			$self->$_->value($v + 5) for qw(P1 P2 P3);
		}
	},
	size => [ 600, 500 ],
);

$w->insert('Prima::ProgressBar',
	name => 'P1',
	pack => { expand => 1, fill => 'x', pad => 20 },
	height => 40,
	value => 50,
	color => cl::LightRed,
);
$w->insert('Prima::ProgressBar',
	name => 'P2',
	pack => { expand => 1, fill => 'x', pad => 20 },
	height => 40,
	value => 50,
	color => cl::Yellow,
);
$w->insert('Prima::ProgressBar',
	name => 'P3',
	pack => { expand => 1, fill => 'x', pad => 20 },
	height => 40,
	value => 50,
	color => cl::Green,
);
$w->insert('Prima::ProgressBar',
	name => 'P4',
	pack => { expand => 1, fill => 'x', pad => 20 },
	height => 40,
	value => 100,
	color => cl::Blue,
);

run Prima;

Hry