delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/05/01/04:29:00

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: "Hans" <hansydelm AT yahoo DOT co DOT uk>
Subject: Re: textcolor() for cygwin?
Date: Thu, 1 May 2003 09:26:54 +0100
Lines: 44
Message-ID: <b8qllg$9vl$1@main.gmane.org>
References: <b8mi5n$qom$1 AT main DOT gmane DOT org> <Pine DOT LNX DOT 4 DOT 44 DOT 0304301349481 DOT 23693-100000 AT localhost DOT localdomain>
X-Complaints-To: usenet AT main DOT gmane DOT org
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

Thanks Ronald,

It works great!

Hans.

#include <ncurses.h>
int main(void)
{
    initscr();         // init ncurses
    start_color(); // Init color mode
    init_pair(1, COLOR_RED, COLOR_BLACK);
    attron(COLOR_PAIR(1));
    printw("Colour red");
    refresh();
    attroff(COLOR_PAIR(1));
    endwin();
}

"Ronald Landheer-Cieslak" <ronald AT landheer DOT com> wrote in message
news:Pine DOT LNX DOT 4 DOT 44 DOT 0304301349481 DOT 23693-100000 AT localhost DOT localdomain...
> On Tue, 29 Apr 2003, Hans wrote:
> > This must be a simple question but for some reason my google search
> > turned up nothing useful. I would like to change the textcolor using C,
> > is there any simple way of doing this? I don't need screen control or
> > anything fancy, just change some text strings to red,
> Actually, changing the color of a displayed text is pretty fancy, if you
> ask me! How are you going to change the color on a B/W terminal? How are
> you going to know your terminal is B/W if you don't want to do something
> in the least bit fancy?
>
> Anyway, try using curs_color(3X) from ncurses - that should help and does
> most of the fancy stuff for you :)
>
> HTH
>
> rlc
>
> BTW: ncurses is in the Cygwin net distri, before anyone asks..
>
>
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019