move or wmove Subroutine

Purpose

Window location cursor functions.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
int move (int y, int x);
int wmove (WINDOW *win, int y, int x);

Description

The move and wmove subroutines move the logical cursor associated with the current or specified window to (y, x) relative to the window's origin. This subroutine does not move the cursor of the terminal until the next refresh (refresh or wrefresh Subroutine) operation.

Parameters

Item Description
y Holds the line or row coordinate of the logical cursor.
x Holds the column coordinate of the logical cursor.
*win Identifies the window in which the cursor is being moved.

Return Values

Upon successful completion, these subroutines return OK. Otherwise, they return ERR.

Examples

  1. To move the logical cursor in the stdscr to the coordinates y = 5, x = 10, use:
    move(5, 10);
  2. To move the logical cursor in the user-defined window my_window to the coordinates y = 5, x = 10, use:
    WINDOW *my_window;
    wmove(my_window, 5, 10);