]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - doc/html/ncurses-intro.html
ncurses 5.9 - patch 20120114
[ncurses.git] / doc / html / ncurses-intro.html
index bf56ddeee168cc7aeb96cb6e439fcef04f01a942..fc529f293e23d63d704a6a57dedfd35b303ef63a 100644 (file)
@@ -1,8 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN">
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <!--
-  $Id: ncurses-intro.html,v 1.42 2006/12/24 16:11:25 tom Exp $
+  $Id: ncurses-intro.html,v 1.44 2010/12/04 16:46:22 tom Exp $
   ****************************************************************************
-  * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
+  * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
   *                                                                          *
   * Permission is hereby granted, free of charge, to any person obtaining a  *
   * copy of this software and associated documentation files (the            *
@@ -914,15 +914,14 @@ Here is some sample code for shellout:
 
 <H3><A NAME="xterm">Using NCURSES under XTERM</A></H3>
 
-A resize operation in X sends SIGWINCH to the application running under xterm.
-The <CODE>ncurses</CODE> library provides an experimental signal
-handler, but in general does not catch this signal, because it cannot
-know how you want the screen re-painted.  You will usually have to write the
-SIGWINCH handler yourself.  Ncurses can give you some help. <P>
+A resize operation in X sends <CODE>SIGWINCH</CODE> to the application running
+under xterm.
 
-The easiest way to code your SIGWINCH handler is to have it do an
-<CODE>endwin</CODE>, followed by an <CODE>refresh</CODE> and a screen repaint you code
-yourself.  The <CODE>refresh</CODE> will pick up the new screen size from the
+The easiest way to handle <CODE>SIGWINCH</CODE>
+is to do an <CODE>endwin</CODE>,
+followed by an <CODE>refresh</CODE> and a screen repaint you code
+yourself.
+The <CODE>refresh</CODE> will pick up the new screen size from the
 xterm's environment. <P>
 
 That is the standard way, of course (it even works with some vendor's curses
@@ -934,8 +933,17 @@ not resize subwindows which must be shrunk.
 are limited to the new screen dimensions, and pads <CODE>stdscr</CODE>
 with blanks if the screen is larger. <P>
 
-Finally, ncurses can be configured to provide its own SIGWINCH handler,
-based on <CODE>resizeterm</CODE>.
+The <CODE>ncurses</CODE> library provides a SIGWINCH signal handler,
+which pushes a <CODE>KEY_RESIZE</CODE> via the wgetch() calls.
+When <CODE>ncurses</CODE> returns that code,
+it calls <code>resizeterm</CODE>
+to update the size of the standard screen's window, repainting that
+(filling with blanks or truncating as needed).
+It also resizes other windows,
+but its effect may be less satisfactory because it cannot
+know how you want the screen re-painted.
+You will usually have to write special-purpose code to handle
+<CODE>KEY_RESIZE</CODE> yourself.
 
 <H3><A NAME="screens">Handling Multiple Terminal Screens</A></H3>