In the last episode (Jul 26), Walter Briscoe said:
I have an application running on an AIX curses port with which I am
not quite happy. I would like to read the character and attributes at
an arbitrary position in a window. To me, it seems perverse to
duplicate the information in the window by holding a copy of it in my
own code.
mvwinch(win, y, x) gives me that information at the cost of changing the
cursor position.
You can use the getyx() macro to get the current cursor position.
getyx() returns this information. Actually - almost all of the positioning
information can be read/written via the normal curses macros and functions.
(I noticed that _begx/_begy are neglected).
Something like this is certainly preferable:
int mywinch(WINDOW *win, int y, int x)
{
int result;
int save_y, save_x;
getyx(win, save_y, save_x);
result = mvwin(win, y, x);
wmove(win, save_y, save_x);
return result;
}