1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/usr/bin/perl -w
# $Id: scale,v 1.3 2013/07/14 22:46:19 tom Exp $
#
# Purpose:
# To demonstrate the Perl5 Cdk Scale Widget
use strict;
#
# Initialize Cdk.
#
use Cdk;
Cdk::init();
# Create the scale object.
my $scale = new Cdk::Scale(
'Label' => "</5>Pick A Number: ",
'Low' => 1,
'High' => 10
);
# Activate the object.
my $number = $scale->activate();
# Check the results.
if ( !defined $number ) {
popupLabel( ["<C>Escape hit. No number selected."] );
}
else {
popupLabel( ["<C>You selected $number"] );
}
# Exit Cdk.
Cdk::end();
# Print out the info.
print "\n\n\n";
print "Number Chosen: $number\n";
|