# s-lang output for DCT, by Shiar
+# 1.14.0 200508261255 - SIGWINCH handler to redraw on screen resize
# 1.13.0 200411042100 - menu i/o functions
# - refresh hook renamed to showall
# 1.12.0 200411032145 - define main loop
use vars qw(%falias $path);
require $path."termcommon.pm";
+sub setsize {
+ ($set{height}, $set{width}) = @_;
+ $set{height} -= 3;
+ $set{menushow} = int($set{width}/(4+$set{width}/20))+1; # menu items to show simultaneously
+} # setsize
+
push @{$hook{init}}, sub {
SLtt_get_terminfo and exit;
SLang_init_tty(-1, 0, 1);
END { SLsmg_reset_smg; SLang_reset_tty; } # shutdown display system
+ $SIG{WINCH} = sub {
+ #xxx: no signal until keypress?
+ setsize(SLtt_get_screen_size); # get new screen size
+ SLsmg_reinit_smg; # reinitialize to use new size
+ redraw(all=>1); # queue complete refresh
+ draw(); # redraw rightnow
+ }; # window change (resize)
+
# where are $SLtt_Screen_Rows and $SLtt_Screen_Cols?
- ($set{height}, $set{width}) = SLtt_get_screen_size;
- $set{height} -= 3;
- $set{menushow} = int($set{width}/(4+$set{width}/20))+1; # menu items to show simultaneously
+ setsize(SLtt_get_screen_size);
}; # init
push @{$hook{showerror}}, sub {
return {
author => "Shiar",
title => "slang output",
- version => "1.13",
+ version => "1.14",
};