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;
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