getmaxyx Subroutine

Purpose

Returns the size of a window.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>

getmaxyx( Window, Y, X);
WINDOW *Window;
int  Y,  X;

Description

The getmaxyx subroutine returns the size of a window. The size is returned as the number of rows and columns in the window. The values are stored in integers Y and X.

Parameters

Item Description
Window Identifies the window whose size to get.
Y Contains the number of rows in the window.
X Contains the number of columns in the window.

Example

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.