On Mon, 09 Oct 2006 18:12:02 -0700, Paul wrote:
> Any chance you could add some kind of SIGWINCH / KEY_RESIZE "support"
> for Windows?
I was thinking about that the other day. It might be possible.
> Even if it did nothing, it would be nice if the symbols were defined,
> to make it easier to compile programs that use them.
KEY_RESIZE is already defined, for all platforms. SIGWINCH is normally
defined in <signal.h>, and is outside the scope of curses. If you don't
care whether it works, you may as well #define it yourself. Programs
that reference SIGWINCH should be checking whether it's defined, anyway.
On platforms where PDCurses has working KEY_RESIZE support (namely X11,
for now), you don't need and shouldn't try to hook SIGWINCH yourself. For
that matter, even in ncurses, you don't need to hook SIGWINCH since about
5.0, unless SIGWINCH support was explicitly disabled when building it.
Just check for KEY_RESIZE on input, and if found, call "resize_term(0,0)";
then repaint your windows. It's the same in ncurses, except you don't call
resize_term() there. See rain.c, worm.c and testcurs.c in PDCurses' demos
directory for some simple examples. (And for a complex example, you could
try MultiMail.)
>> Stay informed about: init_color() in PDCurses