[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

getbegyx, getmaxyx, getparyx, or getyx Subroutine

Purpose

Gets the cursor and window coordinates.

Library

Curses Library (libcurses.a)

Syntax

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 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 x and stores the window's number of columns in 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 getyx macro stores the cursor position of the specified window in y and x.

Parameters

*win Identifies the window to get the coordinates from.
Y Returns the row coordinate.
X Returns the column coordinate.

Examples

For the getbegyx subroutine:

To obtain the beginning coordinates for the my_win window and store in integers y and x, use:

WINDOW *my_win;
int y, x;
getbegyx(my_win, y, x);

For the getmaxyx subroutine:

To obtain the size of the my_win window, use:

WINDOW *my_win;

int y,x;
getmaxyx(my_win, y, x);

Integers y and x will contain the size of the window.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

Controlling the Cursor with Curses in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

Curses Overview for Programming in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

List of Curses Subroutines in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]