bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading characters from WIN*; saving and restoring window cursor


From: Walter Briscoe
Subject: Re: Reading characters from WIN*; saving and restoring window cursor
Date: Mon, 29 Jul 2002 15:36:19 +0100
User-agent: Turnpike/6.02-S (<XRTseyVkrexFjzXkqWRNCbMOZN>)

In message <address@hidden> of Fri, 26 Jul 2002 13:14:00 in , Dan Nelson <address@hidden> writes
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.


Thanks, Dan and Thomas Dickey for the following:

In message <address@hidden> of Fri, 26 Jul 2002 14:25:32 in , Thomas Dickey <address@hidden> writes
On Fri, Jul 26, 2002 at 04:58:47PM +0100, Walter Briscoe wrote:
[snip]
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;
}


I missed getyx(). Am I unreasonable to expect functionality akin to mywinch to be provided as part of the API?
--
Walter Briscoe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]