bug-ncurses
[Top][All Lists]
Advanced

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

Re: increase the maximum number of color pair


From: hingwah
Subject: Re: increase the maximum number of color pair
Date: Fri, 10 May 2002 15:47:53 +0800
User-agent: Mutt/1.3.28i

On Thu, May 09, 2002 at 02:11:16PM -0700, Daniel Weaver wrote:
> At 04:06 AM 5/10/2002 +0800, address@hidden wrote:
> >On Thu, May 09, 2002 at 03:34:43PM -0400, Thomas Dickey wrote:
> >> On Thu, May 09, 2002 at 11:15:39PM +0800, address@hidden wrote:
> >> > 
> >> > Hello,
> >> > 
> >> >  Is there anyway to increase the maximum number of color pairs
> >> >  apart from modify the terminfo "pair#64" to larger value?
> >> 
> >> no.
> >> 
> >> >  otherwise,we can't use all the color available at the same times
> >> >  (pair 0 can't be changed ,so we need 8*8+1 = 65 pair,moreover,
> >> >  including the default color (-1), we need 9*9+1=82 pair for
> >> >  that..
> >> 
> >> "default" is built-in and doesn't count toward color-pairs.
> >but if we use default color by calling use_default_color, 
> >we will have an addition color number -1 for foreground and background
> >and this can have a combination  of init_pair(-1,0); to init_pair(-1,7);
> >and init_pair(0,-1) to init_pair(7,-1); which result in additional 16
> >pair which can be fully represented by the current max number of color
> >pair if we try to initialize all the available pair..i.e 8*8+16 = 80..
> 
> The number of color pairs in the terminfo is set to the number supported
> by the terminal.  If you want more pairs then you need a different
> terminal.
> 
> The default color pairs can be overwritten by the application.

How?
doing COLOR_PAIRS=... after initscr(); seem to work,but it seem it
actually corrupt the memory as ncurses don't actually allocate enough
memory for it


> 
> -----------------------------
> Dan Weaver, ZNYX Networks
> address@hidden
> 
> _______________________________________________
> Bug-ncurses mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-ncurses



reply via email to

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