#!/usr/bin/perl -w # $Id: alphalist,v 1.2 2002/07/27 20:11:17 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Alphalist Widget. # # 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' => "_", 'Height' => 20, 'Width' => 60, 'List' => \@info); $alphalist->set ('BoxAttribute' => ""); # Activate the object. my $info = $alphalist->activate(); # Check the results... if (! defined $info) { popupLabel (["You hit escape to exit the widget."]); } else { popupLabel (["You selected ($info)"]); } # Exit Cdk. Cdk::end();