#!/usr/bin/perl -w # $Id: itemlist,v 1.3 2002/07/24 10:04:33 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Itemlist Widget. # # Load in the Cdk Extension. # use Cdk; Cdk::init(); # Create a list of the months of the year. my @months = ( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); # Create an itemlist widget. my $itemlist = new Cdk::Itemlist ('List' => \@months, 'Label' => "Month >>", 'Title' => ["Pick A Month"]); # Activate the object. my $choice = $itemlist->activate(); # Check the results if (!defined $choice) { popupLabel (["Escape hit. No item selected."]); } else { popupLabel (["You selected ($months[$choice])"]); } # Exit Cdk. Cdk::end();