getbegyx.html

来自「unix 下的C开发手册,还用详细的例程。」· HTML 代码 · 共 111 行

HTML
111
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>getbegyx</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_000_404">&nbsp;</a>NAME</h4><blockquote>getbegyx, getmaxyx, getparyx, getyx - get cursor and window coordinates</blockquote><h4><a name = "tag_000_000_405">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="curses.h.html">curses.h</a>&gt;void getbegyx(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>);void getmaxyx(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>);void getparyx(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>);void getyx(WINDOW *<i>win</i>, int <i>y</i>, int <i>x</i>);</code></pre></blockquote><h4><a name = "tag_000_000_406">&nbsp;</a>DESCRIPTION</h4><blockquote>The<i><a href="getyx.html">getyx()</a></i>macro stores the cursor position of the specified window in <i>y</i> and<i>x</i>.<p>The<i><a href="getparyx.html">getparyx()</a></i>macro, if the specified window is a subwindow, stores in <i>y</i>and <i>x</i> the coordinates of the window's origin relative to its parentwindow.  Otherwise, -1 is stored in <i>y</i> and <i>x</i>.<p>The<i>getbegyx()</i>macro stores the absolute screen coordinates of the specified window's originin <i>y</i> and <i>x</i>.<p>The<i><a href="getmaxyx.html">getmaxyx()</a></i>macro stores the number of rows of the specified window in <i>y</i>and stores the window's number of columns in <i>x</i>.</blockquote><h4><a name = "tag_000_000_407">&nbsp;</a>RETURN VALUE</h4><blockquote>No return values are defined.</blockquote><h4><a name = "tag_000_000_408">&nbsp;</a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_000_409">&nbsp;</a>APPLICATION USAGE</h4><blockquote>These interfaces are macros and `&amp;' cannot be used before the<i>y</i> and <i>x</i> arguments.<br>Traditional implementations have often defined the following macros:<p><pre><code>void getbegx(WINDOW *<i>win</i>, int <i>x</i>);<br>void getbegy(WINDOW *<i>win</i>, int <i>y</i>);<br>void getmaxx(WINDOW *<i>win</i>, int <i>x</i>);<br>void getmaxy(WINDOW *<i>win</i>, int <i>y</i>);<br>void getparx(WINDOW *<i>win</i>, int <i>x</i>);<br>void getpary(WINDOW *<i>win</i>, int <i>y</i>);</code></pre><p>Although<i>getbegyx()</i>,<i><a href="getmaxyx.html">getmaxyx()</a></i>and<i><a href="getparyx.html">getparyx()</a></i>provide the required functionality, this does not preclude applicationsfrom defining these macros for their own use. For example, toimplement<br><pre><code>void getbegx(WINDOW *<i>win</i>, int <i>x</i>);</code></pre>the macro would be<p><pre>    #define getbegx(_win,_x)     \    {                            \        int _y;                  \                                 \        getbegyx(_win,_y,_x);    \    }</pre></blockquote><h4><a name = "tag_000_000_410">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="curses.h.html">&lt;curses.h&gt;</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 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 + =
减小字号Ctrl + -
显示快捷键?