getyx Macro

Purpose

Returns the coordinates of the logical cursor in the specified window.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

getyx( Window,  Line,  Column)
WINDOW *Window;
int Line, Column;

Description

The getyx macro returns the coordinates of the logical cursor in the specified window.

Parameters

Item Description
Window Identifies the window to get the cursor location from.
Column Holds the column coordinate of the logical cursor.
Line Holds the line or row coordinate of the logical cursor.

Example

To get the location of the logical cursor in the user-defined window my_window and then put these coordinates in the user-defined integer variables Line and Column, enter:

WINDOW *my_window;
int line, column;
getyx(my_window, line, column);