]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_outopts.3x
ncurses 4.2
[ncurses.git] / man / curs_outopts.3x
1 .\" $Id: curs_outopts.3x,v 1.10 1998/02/07 21:56:39 tom Exp $
2 .TH curs_outopts 3X ""
3 .SH NAME
4 \fBclearok\fR, \fBidlok\fR, \fBidcok immedok\fR,
5 \fBleaveok\fR, \fBsetscrreg\fR, \fBwsetscrreg\fR, \fBscrollok\fR,
6 \fBnl\fR, \fBnonl\fR - \fBcurses\fR output options
7 .SH SYNOPSIS
8 \fB#include <curses.h>\fR
9
10 \fBint clearok(WINDOW *win, bool bf);\fR
11 .br
12 \fBint idlok(WINDOW *win, bool bf);\fR
13 .br
14 \fBvoid idcok(WINDOW *win, bool bf);\fR
15 .br
16 \fBvoid immedok(WINDOW *win, bool bf);\fR
17 .br
18 \fBint leaveok(WINDOW *win, bool bf);\fR
19 .br
20 \fBint setscrreg(int top, int bot);\fR
21 .br
22 \fBint wsetscrreg(WINDOW *win, int top, int bot);\fR
23 .br
24 \fBint scrollok(WINDOW *win, bool bf);\fR
25 .br
26 \fBint nl(void);\fR
27 .br
28 \fBint nonl(void);\fR
29 .br
30 .SH DESCRIPTION
31 These routines set options that change the style of output within
32 \fBcurses\fR.  All options are initially \fBFALSE\fR, unless otherwise stated.
33 It is not necessary to turn these options off before calling \fBendwin\fR.
34
35 If \fBclearok\fR is called with \fBTRUE\fR as argument, the next
36 call to \fBwrefresh\fR with this window will clear the screen completely and
37 redraw the entire screen from scratch.  This is useful when the contents of the
38 screen are uncertain, or in some cases for a more pleasing visual effect.  If
39 the \fIwin\fR argument to \fBclearok\fR is the global variable \fBcurscr\fR,
40 the next call to \fBwrefresh\fR with any window causes the screen to be cleared
41 and repainted from scratch.
42
43 If \fBidlok\fR is called with \fBTRUE\fR as second argument, \fBcurses\fR
44 considers using the hardware insert/delete line feature of terminals so
45 equipped.  Calling \fBidlok\fR with \fBFALSE\fR as second argument disables use
46 of line insertion and deletion.  This option should be enabled only if the
47 application needs insert/delete line, for example, for a screen editor.  It is
48 disabled by default because insert/delete line tends to be visually annoying
49 when used in applications where it isn't really needed.  If insert/delete line
50 cannot be used, \fBcurses\fR redraws the changed portions of all lines.
51
52 If \fBidcok\fR is called with \fBFALSE\fR as second argument, \fBcurses\fR
53 no longer considers using the hardware insert/delete character feature of
54 terminals so equipped.  Use of character insert/delete is enabled by default.
55 Calling \fBidcok\fR with \fBTRUE\fR as second argument re-enables use
56 of character insertion and deletion.
57
58 If \fBimmedok\fR is called with \fBTRUE as argument\fR, any change
59 in the window image, such as the ones caused by \fBwaddch, wclrtobot, wscrl\fR,
60 \fIetc\fR., automatically cause a call to \fBwrefresh\fR.  However, it may
61 degrade performance considerably, due to repeated calls to \fBwrefresh\fR.
62 It is disabled by default.
63
64 Normally, the hardware cursor is left at the location of the window cursor
65 being refreshed.  The \fBleaveok\fR option allows the cursor to be left
66 wherever the update happens to leave it.  It is useful for applications where
67 the cursor is not used, since it reduces the need for cursor motions.  If
68 possible, the cursor is made invisible when this option is enabled.
69
70 The \fBsetscrreg\fR and \fBwsetscrreg\fR routines allow the application
71 programmer to set a software scrolling region in a window.  \fItop\fR and
72 \fIbot\fR are the line numbers of the top and bottom margin of the scrolling
73 region.  (Line 0 is the top line of the window.)  If this option and
74 \fBscrollok\fR are enabled, an attempt to move off the bottom margin line
75 causes all lines in the scrolling region to scroll one line in the direction
76 of the first line.  Only the text of the window is scrolled.  (Note that this
77 has nothing to do with the use of a physical scrolling region capability in the
78 terminal, like that in the VT100.  If \fBidlok\fR is enabled and the terminal
79 has either a scrolling region or insert/delete line capability, they will
80 probably be used by the output routines.)
81
82 The \fBscrollok\fR option controls what happens when the cursor of a window is
83 moved off the edge of the window or scrolling region, either as a result of a
84 newline action on the bottom line, or typing the last character of the last
85 line.  If disabled, (\fIbf\fR is \fBFALSE\fR), the cursor is left on the bottom
86 line.  If enabled, (\fIbf\fR is \fBTRUE\fR), the window is scrolled up one line
87 (Note that in order to get the physical scrolling effect on the terminal, it is
88 also necessary to call \fBidlok\fR).
89
90 The \fBnl\fR and \fBnonl\fR routines control whether the underlying display
91 device translates the return key into newline on input, and whether it
92 translates newline into return and line-feed on output (in either case, the
93 call \fBaddch('\n')\fR does the equivalent of return and line feed on the
94 virtual screen).  Initially, these translations do occur.  If you disable them
95 using \fBnonl\fR, \fBcurses\fR will be able to make better use of the line-feed
96 capability, resulting in faster cursor motion.  Also, \fBcurses\fR will then be
97 able to detect the return key.
98 .SH RETURN VALUE
99 The functions \fBsetscrreg\fR and \fBwsetscrreg\fR return \fBOK\fR upon success
100 and \fBERR\fR upon failure. All other routines that return an integer always
101 return \fBOK\fR.
102 .SH PORTABILITY
103 These functions are described in the XSI Curses standard, Issue 4.
104
105 The XSI Curses standard is ambiguous on the question of whether \fBraw\fR()
106 should disable the CRLF translations controlled by \fBnl\fR() and \fBnonl\fR().
107 BSD curses did turn off these translations; AT&T curses (at least as late as
108 SVr1) did not.  We choose to do so, on the theory that a programmer requesting
109 raw input wants a clean (ideally 8-bit clean) connection that the operating
110 system does not mess with.
111
112 Some historic curses implementations had, as an undocumented feature, the
113 ability to do the equivalent of \fBclearok(..., 1)\fR by saying
114 \fBtouchwin(stdscr)\fR or \fBclear(stdscr)\fR.  This will not work under
115 ncurses.
116
117 Earlier System V curses implementations specified that with \fBscrollok\fR 
118 enabled, any window modification triggering a scroll also forced a physical
119 refresh.  XSI Curses does not require this, and \fBncurses\fR avoids doing
120 it in order to perform better vertical-motion optimization at \fBwrefresh\fR
121 time.
122
123 The XSI Curses standard does not mention that the cursor should be
124 made invisible as a side-effect of \fBleaveok\fR.
125 SVr4 curses does this.
126 .SH NOTES
127 Note that \fBclearok\fR, \fBleaveok\fR, \fBscrollok\fR, \fBidcok\fR, \fBnl\fR,
128 \fBnonl\fR and \fBsetscrreg\fR may be macros.
129
130 The \fBimmedok\fR routine is useful for windows that are used as terminal
131 emulators.
132 .SH SEE ALSO
133 \fBcurses\fR(3X), \fBcurs_addch\fR(3X), \fBcurs_clear\fR(3X),
134 \fBcurs_initscr\fR(3X), \fBcurs_scroll\fR(3X), \fBcurs_refresh\fR(3X)
135 .\"#
136 .\"# The following sets edit modes for GNU EMACS
137 .\"# Local Variables:
138 .\"# mode:nroff
139 .\"# fill-column:79
140 .\"# End: