File: buttonbox

package info (click to toggle)
libcdk-perl 4.9.10-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 912 kB
  • ctags: 410
  • sloc: perl: 6,419; sh: 27; makefile: 4
file content (41 lines) | stat: -rwxr-xr-x 736 bytes parent folder | download | duplicates (4)
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
38
39
40
41
#!/usr/bin/perl -w
# $Id: buttonbox,v 1.2 2002/07/27 20:11:17 tom Exp $

#
# Purpose:
#	To demonstrate the Perl5 Cdk Buttonbox Widget.

#
# Initialize Cdk.
#
use Cdk;
Cdk::init();

# Create the buttonbox buttons.
my @buttons = ("</3>Button 0<!3>",
		"</4>Button 1<!4>",
		"</5>Button 2<!5>",
		"</6>Button 3<!6>");

# Create the buttonbox object.
my $buttonbox = new Cdk::Buttonbox ( 'Buttons' => \@buttons,
					'Height' => 1,
					'Width' => 50,
					'Cols' => 4,
					'Rows' => 1);

# Activate the object.
my $button = $buttonbox->activate();

# Check the results.
if (!defined $button)
{
   popupLabel (["<C>Escape hit. No button selected."]);
}
else
{
   popupLabel (["<C>You selected button $button"]);
}

# Exit Cdk.
Cdk::end();