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

 NAME

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

 SYNOPSIS



#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);

 DESCRIPTION

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.

 RETURN VALUE

No return values are defined.

 ERRORS

No errors are defined.

 APPLICATION USAGE

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);    \
    }

 SEE ALSO

<curses.h>.

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