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