On Tue, May 31, 2005 at 09:21:29PM +0930, Ron wrote:
> Package: libncurses5
> Version: 5.4-4
> Severity: normal
> 
> Hi,
> 
> doing something like, for example, mvwprintw( stdscr, 23, 79, "x" )
> in an 80 x 24 terminal returns ERR even though the entire string can be
> (and is) displayed correctly on the screen.
> 
> The ERR would appear to be based on advancing the cursor position to
> an invalid row in preparation for the next addch -- but since we never
> write to that invalid position, it seems a bit unproductive to report
> an error when writing to the last legal position before it.
> 
> I can't find anything authoritative that specifies what _should_ happen
> here, but the current behaviour does not seem very useful if an app
> wishes to permit writing to the lower right cell, _and_ check for errors
> that may be reported by libncurses.
> 
> I have a vague memory of some historical issue related to this, but
> can't pin it down for the moment.

Well, if I understand the problem right, the cursor's location _would_
be off the screen after doing this.  This is the closest that I can
see:

 * The _WRAPPED flag is useful only for telling an application that we've just
 * wrapped the cursor.  We don't do anything with this flag except set it when
 * wrapping, and clear it whenever we move the cursor.  If we try to wrap at
 * the lower-right corner of a window, we cannot move the cursor (since that
 * wouldn't be legal).  So we return an error (which is what SVr4 does). 
 * Unlike SVr4, we can successfully add a character to the lower-right corner
 * (Solaris 2.6 does this also, however).

I don't think the defined interfaces for ncurses allow any way for you
to figure this out.  The best you could do would be check whether
_WRAPPED was set; that makes it very likely, if not actually certain,
that the lower right cell was filled.  Assuming the string wasn't too
long for the screen, of course.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to