[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ncurses (init_extended_pair): can't create more than 255 color pairs
From: |
Thomas Dickey |
Subject: |
Re: ncurses (init_extended_pair): can't create more than 255 color pairs |
Date: |
Tue, 21 May 2019 20:35:12 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Mon, May 13, 2019 at 05:24:49AM -0400, Thomas Dickey wrote:
> On Sun, May 12, 2019 at 02:52:10PM +0200, Niegodziwy Beru wrote:
> > Thank you, and sorry for bothering. I rewrite my example according to
> > your suggestions, and attr_set() work, but now I have problem with
> > value pairs above 32767. Pair4 (62000) doesn't change his color. Do I
> > use it correctly, maybe I still missing something?
> >
> > #include <iostream>
> > #include <curses.h>
> >
> > // g++ main.cpp ~/ncurses-6.1-20190504/lib/libncursesw_g.a
> > -I/home/beru/ncurses-6.1-20190504/include/
> >
> > int main() {
> > trace(TRACE_MAXIMUM);
> > WINDOW *scr = initscr();
> > start_color();
> > std::cout << "COLOR_PAIRS: " << COLOR_PAIRS << std::endl;
> >
> > init_extended_color(2, 999, 0, 0);
> > init_extended_color(3, 0, 999, 0);
> >
> > int pair3 = 32767; // 2^15-1
> > if (init_extended_pair(pair3, 2, 3) == ERR)
> > std::cout << "Error init: " << pair3 << std::endl;
> >
> > _tracef("Example pair3");
> > attr_set(A_COLOR, (short) pair3, (void *) &pair3);
>
> The A_COLOR isn't right - that might be the problem.
> I'd just use A_NORMAL there.
>
> (I'll look closer later, am busy with a different program).
I see the problem, now: the updates are using vidputs rather than vid_puts
in the wide-character configure (not a new problem). I'll make a fix
in the next week or two.
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: Digital signature