2 #pacman -S perl-curses-ui
6 setlocale
('LC_COLLATE', 'cs_CZ.utf8');
17 my $cui = new Curses
::UI
(-color_support
=> 1, -language
=> "czech");
20 -label
=> 'Soubor', -submenu
=>
22 {-label
=> 'Nacist Ctrl-O', -value
=> \
&open_file
},
23 {-label
=> 'Ulozit Ctrl-S', -value
=> \
&save
},
24 {-label
=> 'Konec Ctrl-X', -value
=> \
&exit_dialog
}
28 -label
=> 'Napoveda', -submenu
=>
30 {-label
=> 'O aplikaci', -value
=> \
&about
},
53 my $label = $win->add(
60 my $texteditor = $win->add(
64 -vscrollbar
=> 1,-y
=>2,
69 open_file
($ARGV[0]) if $ARGV[0] && (-r
$ARGV[0]);
72 $cui->set_binding(\
&open_file
, "\cO");
73 $cui->set_binding(\
&save
, "\cS");
74 $cui->set_binding(\
&exit_dialog
, "\cX");
75 $cui->set_binding(sub {$menu->focus();}, "\t");
80 my $return = $cui->dialog(
81 -message
=> "Chcete ukoncit program?",
82 -title
=> "Jste si jisty?",
83 -buttons
=> ['yes', 'no'],
90 $soubor = $cui->loadfilebrowser(
94 if($soubor and -r
$soubor and -T
$soubor){
98 $texteditor->text($data);
100 ($path) = $soubor =~ /^(.*\/).*$/;
102 $label->text("Soubor: ".$file);
104 $cui->error("Nevybral jste soubor");
110 my $soubor = $cui->savefilebrowser(
116 open CIL
, ">$soubor";
117 print CIL
$texteditor->get();
119 ($path) = $soubor =~ /^(.*\/).*$/;
121 $label->text("Soubor: ".$file);
123 $cui->error("Nevybral jste soubor");
128 $cui->dialog("Toto je napoveda");
This page took 0.536684 seconds and 4 git commands to generate.