1 # s-lang output for DCT, by Shiar
3 # 1.11.0 200410291300 -
8 use Term::Slang qw(:common :screen :term :CONSTANTS);
10 push @{$hook{init}}, sub {
11 SLtt_get_terminfo and exit;
12 SLang_init_tty(-1, 0, 1);
15 END { SLsmg_reset_smg; SLang_reset_tty; } # shutdown display system
17 # where are $SLtt_Screen_Rows and $SLtt_Screen_Cols?
18 ($set{height}, $set{width}) = SLtt_get_screen_size;
22 push @{$hook{showerror}}, sub {
24 SLsmg_draw_box(0, 0, 3, length($error)+4);
26 SLsmg_write_string(" $error ");
29 ReadKey; # wait for confirm
30 1 while defined ReadKey(-1); # clear key buffer
33 push @{$hook{showstack}}, sub {
35 SLsmg_gotorc($set{height}-$_, 1);
36 SLsmg_write_string("$_: ".showval($stack[$_], $set{base})); # prompt
39 SLsmg_gotorc($set{height}-@stack, 1);
43 push @{$hook{refresh}}, sub {
45 SLsmg_gotorc($set{height}+1, 0);
46 SLsmg_write_string("> "); # prompt
49 push @{$hook{showentry}}, sub {
50 SLsmg_gotorc($set{height}+1, 2);
51 SLsmg_write_string($_[0]);
58 title => "slang output",