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
|
#!/usr/bin/perl -w
# $Id: fselect,v 1.3 2013/07/14 22:50:28 tom Exp $
#
# Purpose:
# To demonstrate the Perl5 Cdk file selector widget.
use strict;
#
# Load in the Cdk Extension.
#
use Cdk;
Cdk::init();
# Create the file selector.
my $fselect = new Cdk::Fselect(
'Label' => "</B/16>Filename:",
'Filler' => "</B/24>_",
'Height' => 0,
'Width' => 0
);
# Activate the object.
$fselect->set( 'ULChar' => "#" );
my $filename = $fselect->activate();
# Check the results.
if ( !defined $filename ) {
popupLabel( ["<C>You hit escape. No file selected."] );
}
else {
popupLabel( [ "<C>You selected the following file", "<C>($filename)" ] );
}
# Exit Cdk.
Cdk::end();
|