#!/usr/bin/perl -w # $Id: scroll,v 1.2 2002/07/27 20:11:17 tom Exp $ # # Purpose: # To demonstrate the Perl5 Cdk Scroll Widget # # Initialize Cdk. # use Cdk; Cdk::init(); # Set up the scrolling list. @listItems = ("Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9"); # Create the scrolling list object. my $scroll = new Cdk::Scroll ('Title' => "Scroll Title", 'Height' => -10, 'Width' => -10, 'Numbers' => "TRUE", 'Spos' => "RIGHT", 'List' => \@listItems); $scroll->add ('Item' => "HELLO"); # Activate the scrolling list. my $itemPicked = $scroll->activate (); # Check the results. if (!defined $itemPicked) { popupLabel (["Escape hit. No menu item selected."]); } else { popupLabel (["You selected $listItems[$itemPicked]"]); } # Exit Cdk. Cdk::end();