1 # ncurses output for DCT, by Shiar
3 # 1.10.1 200410140120 - all output functions seperated from main
10 return 0 if $set{display};
11 $set{display} = "curses";
13 push @{$hook{init}}, sub {
15 END { endwin; } # restore terminal on quit
17 $set{height} = $LINES-2 if $LINES>=3;
18 $set{width} = $COLS if $COLS;
21 push @{$hook{showerror}}, sub {
28 ReadKey; # wait for confirm
29 1 while defined ReadKey(-1); # clear key buffer
32 push @{$hook{showstack}}, sub {
34 addstr($set{height}-$_, 1, "$_: ".showval($stack[$_], $set{base}));
37 clrtoeol($set{height}-@stack, 1);
40 push @{$hook{refresh}}, sub {
42 addstr($set{height}+1, 0, "> "); # prompt
45 push @{$hook{showentry}}, sub {
46 addstr($set{height}+1, 2, $_[0]);
53 title => "curses output",