File: buttonbox

package info (click to toggle)
libcdk-perl 20240606-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,732 kB
  • sloc: perl: 6,146; sh: 3,599; makefile: 28
file content (45 lines) | stat: -rwxr-xr-x 776 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
42
43
44
45
#!/usr/bin/perl -w
# $Id: buttonbox,v 1.3 2013/07/14 22:54:32 tom Exp $

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

use strict;

#
# 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();