📄 prefresh.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>newpad</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><xref type="10" name="newpad"></xref><h4><a name = "tag_001_009_736"> </a>NAME</h4><blockquote>newpad, pnoutrefresh, prefresh, subpad - pad management functions</blockquote><h4><a name = "tag_001_009_737"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="curses.h.html">curses.h</a>>WINDOW *newpad(int <i>nlines</i>, int <i>ncols</i>);int pnoutrefresh(WINDOW *<i>pad</i>, int <i>pminrow</i>, int <i>pmincol</i>, int <i>sminrow</i>, int <i>smincol</i>, int <i>smaxrow</i>, int <i>smaxcol</i>);int prefresh(WINDOW *<i>pad</i>, int <i>pminrow</i>, int <i>pmincol</i>, int <i>sminrow</i>, int <i>smincol</i>, int <i>smaxrow</i>, int <i>smaxcol</i>);WINDOW *subpad(WINDOW *<i>orig</i>, int <i>nlines</i>, int <i>ncols</i>, int <i>begin_y</i>, int <i>begin_x</i>);</code></pre></blockquote><h4><a name = "tag_001_009_738"> </a>DESCRIPTION</h4><blockquote>The<i>newpad()</i>function creates a specialised <b>WINDOW</b> data structure representing a padwith <i>nlines</i> lines and <i>ncols</i> columns. A pad is like a window,except that it is not necessarily associated with a viewable part of thescreen. Automatic refreshes of pads do not occur.<p>The<i><a href="subpad.html">subpad()</a></i>function creates a subwindow within a pad with <i>nlines</i> lines and<i>ncols</i> columns. Unlike<i><a href="subwin.html">subwin()</a></i>,which uses screen coordinates, the window is at position (<i>begin_y</i>,<i>begin_x</i>) on the pad. The window is made in the middle of the window<i>orig</i>, so that changes made to one window affect both windows.<p>The<i>prefresh()</i>and<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>functions are analogous to<i><a href="wrefresh.html">wrefresh()</a></i>and<i><a href="wnoutrefresh.html">wnoutrefresh()</a></i>except that they relate to pads instead of windows. The additional argumentsindicate what part of the pad and screen are involved.The <i>pminrow</i> and <i>pmincol</i> arguments specify the origin of therectangle to be displayed in the pad. The <i>sminrow</i>, <i>smincol</i>,<i>smaxrow</i> and <i>smaxcol</i> argumentsspecify the edges of the rectangle to bedisplayed on the screen. The lower right-hand corner of the rectangle to bedisplayed in the pad is calculated from the screen coordinates, since therectangles must be the same size. Both rectangles must be entirely containedwithin their respective structures. Negative values of <i>pminrow</i>,<i>pmincol</i>, <i>sminrow</i> or <i>smincol</i> are treated as if they werezero.</blockquote><h4><a name = "tag_001_009_739"> </a>RETURN VALUE</h4><blockquote>Upon successful completion, the<i>newpad()</i> and<i><a href="subpad.html">subpad()</a></i> functions return a pointer to the pad data structure. Otherwise, they returna null pointer.<p>Upon successful completion,<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>and<i>prefresh()</i>return OK. Otherwise, they return ERR.</blockquote><h4><a name = "tag_001_009_740"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_001_009_741"> </a>APPLICATION USAGE</h4><blockquote>To refresh a pad, call<i>prefresh()</i>or<i><a href="pnoutrefresh.html">pnoutrefresh()</a></i>,not<i><a href="wrefresh.html">wrefresh()</a></i>.When porting code to use pads from WINDOWS, remember that these functionsrequire additional arguments to specify the part of the pad to be displayedand the location on the screen to be used for the display.<p>Although a subwindow and its parent pad may share memory representingcharacters in the pad, they need not share status information about what haschanged in the pad. Therefore, after modifying a subwindow within a pad, itmay be necessary to call<i><a href="touchwin.html">touchwin()</a></i>or<i><a href="touchline.html">touchline()</a></i>on the pad before calling<i>prefresh()</i>.</blockquote><h4><a name = "tag_001_009_742"> </a>SEE ALSO</h4><blockquote><i><a href="derwin.html">derwin()</a></i>,<i><a href="doupdate.html">doupdate()</a></i>,<i><a href="is_linetouched.html">is_linetouched()</a></i>,<i><a href="curses.h.html"><curses.h></a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -