-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.pl
67 lines (52 loc) · 1.45 KB
/
start.pl
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use Curses::UI;
use strict;
use warnings;
use diagnostics;
my $cui = Curses::UI->new( -clear_on_exit => 1, -color_support => 1);
my @main = ({ -label => 'APPS',-submenu => [{ -label => 'Messages', -value => \&Messages},
{-label => 'Games', -value => \&Games},
{ -label => 'Reseaux', -value => \&Reseaux},]},
{ -label => 'EXIT', -submenu => [{ -label => 'Quit', -value => \&Quit}]});
my $menu = $cui->add('MENU','Menubar', -menu => \@main,-fg => "green",);
my $win = $cui->add(
'win', 'Window',
-border => 1,
-y => 1,
-bfg => 'red',
);
sub Messages()
{
my $return = $cui->dialog(
-message => "load Messages",
-buttons => ['yes', 'no'],);
}
sub Reseaux()
{
my $return = $cui->dialog(
-message => "load Reseaux",
-buttons => ['yes', 'no'],);
}
sub Games()
{
my $return = $cui->dialog(
-message => "load Games",
-buttons => ['yes', 'no']);
}
sub Quit()
{
my $return = $cui->dialog(
-message => "do you want to exit ?",
-title => "Exit ?",
-buttons => ['yes', 'no'],
);
exit(0) if $return;
}
$cui->set_binding( \&Quit, "\cC");
$cui->set_binding(sub {$menu->focus()}, "\cX");
my $container = $win->add(
'mycontainer', 'Container'
);
$container->add('shurg', 'Label', -text => '¯\_(ツ)_/¯', -x => 10, -y => 5);
#$container->delete('shurg');
$win->focus();
$cui->mainloop();