bug-ncurses
[Top][All Lists]
Advanced

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

Colors in copywin()/overlay()


From: William McBrine
Subject: Colors in copywin()/overlay()
Date: Wed, 7 Dec 2005 16:08:41 -0500 (EST)

I noticed a difference in the way copywin() and its derivatives are handled by ncurses vs. PDCurses. When overlaying text, ncurses takes attributes like A_BOLD from the original window, but it takes the colors from the destination window. PDCurses takes all attributes, including colors, from the source window. (You can see this in the "testcurs" demo program.)

ncurses' behavior matches that of (at least) Solaris' and NetBSD's curses. However, the Single UNIX Specification, Version 2, seems to me to specify the behavior seen in PDCurses. It says:

 The overwrite() function copies characters as though a sequence of
 win_wch() and wadd_wch() were performed with the destination window's
 attributes and background attributes cleared.

 The overlay() function does the same thing, except that, whenever a
 character to be copied is the background character of the source window,
 overlay() does not copy the character but merely moves the destination
 cursor the width of the source background character.

So, which is wrong: the spec, the implementations, or my understanding? :-)

--
William McBrine <address@hidden>




reply via email to

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