move
SYNOPSIS
#include <ocurses.h>
int move(y, x)
int y, x;
NOTES
-
move positions the cursor for stdscr at the given row y
and the given column x.
-
Notice that move takes the y coordinate
before the x coordinate.
The upper left-hand coordinates for stdscr are (0,0),
the lower right-hand (LINES - 1, COLS - 1).
See
``The routines initscr, refresh, endwin''
for more information.
-
move may be combined with the write functions to form
-
mvaddch (y, x, ch), which moves to a given position
and prints a character
-
mvaddstr (y, x, str), which moves to a given position
and prints a string of characters
-
mvprintw (y, x, fmt [,arg...]),
which moves to a given position and prints a formatted string.
-
move returns COK on success and ERR on error.
Trying to move to a screen position of less than (0,0)
or more than (LINES - 1, COLS - 1) causes an error.
-
move is a macro.
EXAMPLE
#include <ocurses.h>
main()
{
initscr();
addstr("Cursor should be here --> if move() works.");
printw("\n\n\nPress <Return> to end test.");
move(0,25);
refresh();
getch(); /* Gets <Return>; discussed below. */
endwin();
}
Here's the output generated by running this program:
Cursor should be here -->[]if move() works.
Press <Return> to end test.
After you press RETURN, the screen looks like this:
Cursor should be here --> if move() works.
Press <Return> to end test.
$[]
See
``The scatter program''
for another example
using move.
Next topic:
clear and erase
Previous topic:
printw
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004