bug-ncurses
[Top][All Lists]
Advanced

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

Re: color_set


From: Thomas Dickey
Subject: Re: color_set
Date: Tue, 24 Feb 2009 19:35:07 -0500 (EST)

On Tue, 24 Feb 2009, Heracles wrote:


Ok, so are you saying that when you use color_set, the change applies to any
subsequent text added to any window?

that seems accurate (I have a test-case for it - noting that it's for
color_set, not wcolor_set, there's always the possibility of a bug)


If so, suppose we have the case where we invoke:

color_set(1,NULL);
wcolor_set(somewin, 3, NULL);


What would be the subsequent output for this call:
waddstr(somewin, "Which color am I");

looks like it'd be pair-3 (whatever that happens to correspond to)


Provided you ignore syntax errors and other such micelany.




Thomas Dickey-2 wrote:

On Tue, Feb 24, 2009 at 09:05:27AM -0800, Heracles wrote:

I would like someone to clarify the semantics of color_set.  The man
pages

       int color_set(short color_pair_number, void* opts);

say that color_set takes a color_pair_number argument which is apparently
an
index into a collection of color pairs, and a null pointer as the opts.

It's not a collection per se, but the "same" color table as
some applications use by OR'ing the color pair into a chtype.

However, color_set takes a short for the pair number, while
the field in chtype is (for ncurses) only 8 bits).

The type is a short (signed) since that corresponds to the
type used for numbers in compiled terminfo.

To what window(s) do(es) the changes apply when using this method versus
the
wcolor_set method?

stdscr

(I see the manpage has a typo - it refers to the given window, which
would be for wcolor_set).

How do you establish the collection to be indexed in the first place?

--
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net


_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses



--
View this message in context: 
http://www.nabble.com/color_set-tp22185141p22192074.html
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.



_______________________________________________
Bug-ncurses mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-ncurses


--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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