bug-ncurses
[Top][All Lists]
Advanced

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

Re: Ncurses to control the color output only when writing to cout and ce


From: Thomas Dickey
Subject: Re: Ncurses to control the color output only when writing to cout and cerr?
Date: Sat, 06 Dec 2008 18:20:19 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

On Sun, Nov 30, 2008 at 10:04:42AM +0100, Jiri Hladky wrote:
> Hi everybody,
> 
> I would like to use Ncurses to control the color output of my application. 
> However, I would like to use standart cout and cerr streams and terminal 
> itself (konsole or xterm) will take care about scrolling and padding. Is 
> there any easy way how to use ncurses for this purpose? 

It sounds as if you could use low-level (tparm, tputs) to format and
write strings to stdout, and intersperse those with the cout/cerr.

That's using 

        std::ios_base::sync_with_stdio(true);

e.g.,

        http://www.ddj.com/cpp/184401305

> I have done several trials and it seems that I have to create allways a 
> window. I can enable scrolling and I can write to window but when the 
> application finishes the whole output is deleted. This is bad because I need 
> to analyse the results.

You "should" be able to "just" use newterm to initialize the terminal
description, and tparm, tputs.  That's a little better than termcap...

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

Attachment: signature.asc
Description: Digital signature


reply via email to

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