blob: 2cb152d865c7c86ab00908ec81678c1143db5e96 [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
4.\" Permission is hereby granted, free of charge, to any person obtaining a *
5.\" copy of this software and associated documentation files (the *
6.\" "Software"), to deal in the Software without restriction, including *
7.\" without limitation the rights to use, copy, modify, merge, publish, *
8.\" distribute, distribute with modifications, sublicense, and/or sell *
9.\" copies of the Software, and to permit persons to whom the Software is *
10.\" furnished to do so, subject to the following conditions: *
11.\" *
12.\" The above copyright notice and this permission notice shall be included *
13.\" in all copies or substantial portions of the Software. *
14.\" *
15.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
16.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
17.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
18.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
19.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
20.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
21.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
22.\" *
23.\" Except as contained in this notice, the name(s) of the above copyright *
24.\" holders shall not be used in advertising or otherwise to promote the *
25.\" sale, use or other dealings in this Software without prior written *
26.\" authorization. *
27.\"***************************************************************************
28.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_scroll.3x,v 1.15 2010/12/04 18:40:45 tom Exp $
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053030.TH curs_scroll 3X ""
31.na
32.hy 0
33.SH NAME
34\fBscroll\fR,
35\fBscrl\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010036\fBwscrl\fR \- scroll a \fBcurses\fR window
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053037.ad
38.hy
39.SH SYNOPSIS
40\fB#include <curses.h>\fR
41.sp
42\fBint scroll(WINDOW *win);\fR
43.br
44\fBint scrl(int n);\fR
45.br
46\fBint wscrl(WINDOW *win, int n);\fR
47.br
48.SH DESCRIPTION
49The \fBscroll\fR routine scrolls the window up one line.
50This involves moving
51the lines in the window data structure.
52As an optimization, if the scrolling
53region of the window is the entire screen, the physical screen may be scrolled
54at the same time.
55.PP
56For positive \fIn\fR, the \fBscrl\fR and \fBwscrl\fR routines scroll the
57window up \fIn\fR lines (line \fIi\fR+\fIn\fR becomes \fIi\fR); otherwise
58scroll the window down \fIn\fR lines.
59This involves moving the lines in the
60window character image structure.
61The current cursor position is not changed.
62.PP
63For these functions to work, scrolling must be enabled via \fBscrollok\fR.
64.SH RETURN VALUE
65These routines return \fBERR\fR upon failure, and \fBOK\fR (SVr4 only specifies
66"an integer value other than \fBERR\fR") upon successful completion.
67.PP
68X/Open defines no error conditions.
69.PP
70This implementation returns an error
71if the window pointer is null, or
72if scrolling is not enabled in the window, e.g., with \fBscrollok\fP.
73.SH NOTES
74Note that \fBscrl\fR and \fBscroll\fR may be macros.
75.PP
76The SVr4 documentation says that the optimization of physically scrolling
77immediately if the scroll region is the entire screen "is" performed, not
78"may be" performed.
79This implementation deliberately does not guarantee
80that this will occur, to leave open the possibility of smarter
81optimization of multiple scroll actions on the next update.
82.PP
83Neither the SVr4 nor the XSI documentation specify whether the current
84attribute or
85current color-pair of blanks generated by the scroll function is zeroed.
86Under this implementation it is.
87.SH PORTABILITY
88The XSI Curses standard, Issue 4 describes these functions.
89.SH SEE ALSO
90\fBcurses\fR(3X), \fBcurs_outopts\fR(3X)