bug-ncurses
[Top][All Lists]
Advanced

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

Re: color_set


From: Heracles
Subject: Re: color_set
Date: Tue, 24 Feb 2009 14:28:20 -0800 (PST)

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

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");

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.





reply via email to

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