1<!-- 2 **************************************************************************** 3 * Copyright 2018-2023,2024 Thomas E. Dickey * 4 * Copyright 1998-2006,2010 Free Software Foundation, Inc. * 5 * * 6 * Permission is hereby granted, free of charge, to any person obtaining a * 7 * copy of this software and associated documentation files (the * 8 * "Software"), to deal in the Software without restriction, including * 9 * without limitation the rights to use, copy, modify, merge, publish, * 10 * distribute, distribute with modifications, sublicense, and/or sell * 11 * copies of the Software, and to permit persons to whom the Software is * 12 * furnished to do so, subject to the following conditions: * 13 * * 14 * The above copyright notice and this permission notice shall be included * 15 * in all copies or substantial portions of the Software. * 16 * * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 24 * * 25 * Except as contained in this notice, the name(s) of the above copyright * 26 * holders shall not be used in advertising or otherwise to promote the * 27 * sale, use or other dealings in this Software without prior written * 28 * authorization. * 29 **************************************************************************** 30 * @Id: curs_scroll.3x,v 1.43 2024/04/20 18:54:36 tom Exp @ 31--> 32<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> 33<HTML> 34<HEAD> 35<meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> 36<meta name="generator" content="Manpage converted by man2html - see https://invisible-island.net/scripts/readme.html#others_scripts"> 37<TITLE>curs_scroll 3x 2024-04-20 ncurses 6.5 Library calls</TITLE> 38<link rel="author" href="mailto:bug-ncurses@gnu.org"> 39 40</HEAD> 41<BODY> 42<H1 class="no-header">curs_scroll 3x 2024-04-20 ncurses 6.5 Library calls</H1> 43<PRE> 44<STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG> Library calls <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG> 45 46 47 48 49</PRE><H2><a name="h2-NAME">NAME</a></H2><PRE> 50 <STRONG>scroll</STRONG>, <STRONG>scrl</STRONG>, <STRONG>wscrl</STRONG> - scroll a <EM>curses</EM> window 51 52 53</PRE><H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> 54 <STRONG>#include</STRONG> <STRONG><curses.h></STRONG> 55 56 <STRONG>int</STRONG> <STRONG>scroll(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> 57 58 <STRONG>int</STRONG> <STRONG>scrl(int</STRONG> <EM>n</EM><STRONG>);</STRONG> 59 <STRONG>int</STRONG> <STRONG>wscrl(WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>,</STRONG> <STRONG>int</STRONG> <EM>n</EM><STRONG>);</STRONG> 60 61 62</PRE><H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> 63 <STRONG>scroll</STRONG> scrolls the given window up one line. That is, every visible 64 line we might number <EM>i</EM> becomes line <EM>i</EM>-1. The text of the top line in 65 the window disappears and the bottom line is populated with blank 66 characters; see <STRONG><A HREF="curs_bkgd.3x.html">bkgd(3x)</A></STRONG> or <STRONG><A HREF="curs_bkgrnd.3x.html">bkgrnd(3x)</A></STRONG>. As an optimization, if the 67 scrolling region of the window is the entire screen, the physical 68 screen may be scrolled at the same time; see <STRONG><A HREF="curs_variables.3x.html">curscr(3x)</A></STRONG>. 69 70 <STRONG>scrl</STRONG> and <STRONG>wscrl</STRONG> scroll <STRONG>stdscr</STRONG> or the specified window up or down 71 depending on the sign of <EM>n</EM>. 72 73 <STRONG>o</STRONG> For positive <EM>n</EM>, line <EM>i</EM>+<EM>n</EM> becomes <EM>i</EM> (scrolling up); 74 75 <STRONG>o</STRONG> for negative <EM>n</EM>, line <EM>i</EM>-<EM>n</EM> becomes <EM>i</EM> (scrolling down). 76 77 The cursor does not move. These functions perform no operation unless 78 scrolling is enabled for the window via <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG>. 79 80 81</PRE><H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> 82 These functions return <STRONG>ERR</STRONG> upon failure and <STRONG>OK</STRONG> upon success. 83 84 <EM>ncurses</EM> returns <STRONG>ERR</STRONG> if scrolling is not enabled in the window, for 85 example with <STRONG><A HREF="scrollok.3x.html">scrollok(3x)</A></STRONG>, or if the <EM>WINDOW</EM> pointer is null. 86 87 88</PRE><H2><a name="h2-NOTES">NOTES</a></H2><PRE> 89 Unusually, there is no <STRONG>wscroll</STRONG> function; <STRONG>scroll</STRONG> behaves as one would 90 expect <STRONG>wscroll</STRONG> to, accepting a <EM>WINDOW</EM> pointer argument. 91 92 <STRONG>scrl</STRONG> and <STRONG>scroll</STRONG> may be implemented as macros. 93 94 95</PRE><H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> 96 X/Open Curses, Issue 4 describes these functions. It defines no error 97 conditions. 98 99 SVr4 specifies only "an integer value other than <STRONG>ERR</STRONG>" as a successful 100 return value. 101 102 SVr4 indicates that the optimization of physically scrolling 103 immediately if the scroll region is the entire screen "is" performed, 104 not "may be" performed. <EM>ncurses</EM> deliberately does not guarantee that 105 this will occur, to leave open the possibility of smarter optimization 106 of multiple scroll actions on the next update. 107 108 Neither SVr4 <EM>curses</EM> nor X/Open Curses specify whether the current 109 attribute or current color pair of blanks generated by the scroll 110 function are zeroed. <EM>ncurses</EM> does so. 111 112 113</PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> 114 <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_outopts.3x.html">curs_outopts(3x)</A></STRONG> 115 116 117 118ncurses 6.5 2024-04-20 <STRONG><A HREF="curs_scroll.3x.html">curs_scroll(3x)</A></STRONG> 119</PRE> 120<div class="nav"> 121<ul> 122<li><a href="#h2-NAME">NAME</a></li> 123<li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> 124<li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li> 125<li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> 126<li><a href="#h2-NOTES">NOTES</a></li> 127<li><a href="#h2-PORTABILITY">PORTABILITY</a></li> 128<li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> 129</ul> 130</div> 131</BODY> 132</HTML> 133