The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


getbegyx, getmaxyx, getparyx, getyx - get cursor and window coordinates


#include <curses.h>

void getbegyx(WINDOW *win, int y, int x);

void getmaxyx(WINDOW *win, int y, int x);

void getparyx(WINDOW *win, int y, int x);

void getyx(WINDOW *win, int y, int x);


The getyx() macro stores the cursor position of the specified window in y and x.

The getparyx() macro, if the specified window is a subwindow, stores in y and x the coordinates of the window's origin relative to its parent window. Otherwise, -1 is stored in y and x.

The getbegyx() macro stores the absolute screen coordinates of the specified window's origin in y and x.

The getmaxyx() macro stores the number of rows of the specified window in y and stores the window's number of columns in x.


No return values are defined.


No errors are defined.


These interfaces are macros and `&' cannot be used before the y and x arguments.
Traditional implementations have often defined the following macros:

void getbegx(WINDOW *win, int x);

void getbegy(WINDOW *win, int y);
void getmaxx(WINDOW *win, int x);
void getmaxy(WINDOW *win, int y);
void getparx(WINDOW *win, int x);
void getpary(WINDOW *win, int y);

Although getbegyx(), getmaxyx() and getparyx() provide the required functionality, this does not preclude applications from defining these macros for their own use. For example, to implement

void getbegx(WINDOW *win, int x);

the macro would be

    #define getbegx(_win,_x)     \
    {                            \
        int _y;                  \
        getbegyx(_win,_y,_x);    \



UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]