X-Git-Url: http://git.shiar.net/descalc.git/blobdiff_plain/4e1d9535fda6685e53ce570ca4e4cd6c260f55d3..HEAD:/05_disp_stdout.pm diff --git a/05_disp_stdout.pm b/05_disp_stdout.pm index 07be1da..9e0d22d 100644 --- a/05_disp_stdout.pm +++ b/05_disp_stdout.pm @@ -16,7 +16,6 @@ use Term::ReadKey; push @{$hook{init}}, sub { ReadMode 3; # cbreak mode -# print "\ec"; # reset (clear screen, go home) # print "\e[4mDCT $::VERSION\e[24m "; # print intro (underlined) END { ReadMode 0; @@ -38,6 +37,22 @@ push @{$hook{showstack}}, sub { print "\n> "; # prompt }; # showstack +push @{$hook{showmenu}}, sub { + my $nr = -1; + for (grep exists $menu[0][$_], $menu[0][0]+1..$menu[0][0]+$set{menushow}) { + $nr++; + next unless defined $menu[0][$_]; + my $sub = (my $s = $menu[0][$_]) =~ s/>[\w ]+$//; + print " $_:$s"; + print ">" if $sub; # indicate submenu + } # display menu txts + print "\n> "; +}; # showmenu + +push @{$hook{showall}}, sub { +# print "\ec"; # reset (clear screen, go home) +}; # showall + push @{$hook{showentry}}, sub { print "\e[3G\e[K", $_[0]; # cursor to column #3; erase line }; # showentry