#!/usr/bin/perl -w # $Id: radio,v 1.3 2002/07/24 10:04:33 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Radio Widget. # # Initialize Cdk. # use Cdk; Cdk::init(); # Set up the radio list. my @radioList = ("Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10", "Item 11", "Item 12"); # Create the radio list object. my $radioWidget = new Cdk::Radio ('Title' => ["Radio List"], 'List' => \@radioList, 'Height' => 10, 'Width' => 20); # Activate the radio object. $radioWidget->set ('Choice' => "#"); my $choice = $radioWidget->activate (); # Check the results. if (!defined $choice) { popupLabel (["Escape hit. No item selected."]); } else { popupLabel (["You selected $radioList[$choice]."]); } # Exit Cdk. Cdk::end();