/usr/share/doc/libui-dialog-perl/examples/screen-menu.pl is in libui-dialog-perl 1.09-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 46 47 48 49 50 51 52 | #!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;
use constant { TRUE => 1, FALSE => 0 };
use lib qw(./lib);
use UI::Dialog::Screen::Menu;
#
#: Demonstrate usage of UI::Dialog::Screen::Menu
#
our $counter = 0;
my $s = new UI::Dialog::Screen::Menu
(
title => "test title",
text => "test text",
order => [ 'dialog' ]
);
$s->add_menu_item
( "An Action ".$counter,
sub {
my ($self,$dialog,$index) = @_;
$counter++;
$s->set_menu_item( $index, "An Action ".$counter, undef );
}
);
my $s2 = new UI::Dialog::Screen::Menu
(
title => "test 2 title",
text => "test 2 text",
order => [ 'dialog' ]
);
$s2->add_menu_item
( "Another Option",
sub {
my ($self,$dialog,$index) = @_;
$dialog->msgbox( text => "Hi" );
}
);
$s->add_menu_item
( "Next Screen",
sub { $s2->loop(); }
);
$s->loop();
exit 0;
|