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 40 41 42 43
|
#!/usr/bin/perl -w
# $Id: alphalist,v 1.3 2013/07/14 22:55:03 tom Exp $
#
# Purpose:
# To demonstrate the Perl5 Cdk Alphalist Widget.
use strict;
#
# Load in the Cdk Extension.
#
use Cdk;
Cdk::init();
# Get the contents of the current directory.
my @info = qx (ls);
chomp @info;
# Create a new alphalist object.
my $alphalist = new Cdk::Alphalist(
'Label' => "Type Anything:",
'Filler' => "</R/24>_",
'Height' => 20,
'Width' => 60,
'List' => \@info
);
$alphalist->set( 'BoxAttribute' => "</R>" );
# Activate the object.
my $info = $alphalist->activate();
# Check the results...
if ( !defined $info ) {
popupLabel( ["<C>You hit escape to exit the widget."] );
}
else {
popupLabel( ["<C>You selected ($info)"] );
}
# Exit Cdk.
Cdk::end();
|