#!/usr/bin/perl -w # $Id: scale,v 1.2 2002/07/27 20:11:17 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Scale Widget # # Initialize Cdk. # use Cdk; Cdk::init(); # Create the scale object. my $scale = new Cdk::Scale ('Label' => "Pick A Number: ", 'Low' => 1, 'High' => 10); # Activate the object. my $number = $scale->activate (); # Check the results. if (!defined $number) { popupLabel (["Escape hit. No number selected."]); } else { popupLabel (["You selected $number"]); } # Exit Cdk. Cdk::end(); # Print out the info. print "\n\n\n"; print "Number Chosen: $number\n";