Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Aug 2001 12:23:36 +0300
From:      Valentin Nechayev <netch@iv.nn.kiev.ua>
To:        Hans Zaunere <zaunere@yahoo.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: ncurses
Message-ID:  <20010818122335.B399@iv.nn.kiev.ua>
In-Reply-To: <20010816005744.24402.qmail@web12808.mail.yahoo.com>; from zaunere@yahoo.com on Wed, Aug 15, 2001 at 05:57:44PM -0700
References:  <3B7B18EE.6B41ABED@math.missouri.edu> <20010816005744.24402.qmail@web12808.mail.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 Wed, Aug 15, 2001 at 17:57:44, zaunere (Hans Zaunere) wrote about "Re: ncurses": 

> *Whaps himself*  Why didn't I think of that.  However
> the question still lingers, is there anyway to output
> to stdout?  Its kind of a moot point I suppose, just
> curious.

ncurses already outputs to stdout. But it outputs not as line-oriented as
simple printf(). It considers full screen as character matrix, and optimizes
its output according to knowledge of terminal features: it can do full
or partial redraw, writing using window unshifting and deleting text using
shifting; it deals with colors, underlining, etc. Of course you _can_
do printf(), but in this case you won't know _where_ and _how_ your output
appeared (e.g. on last line, blinking green on red background); and in
most cases you'll broke ncurses logic which wasn't written to realize
permament interventions and to redraw after each printed character
or line. As NLPist would say, "you don't want to do this".

Right way is to realize and reflect that when ncurses is activated,
only ncurses output functions should be used. If you want to draw something
on screen for a short time, create ncurses' window, output to it using
ncurses' functions and delete window when it should disappear.
You can discover tens of other ways to write message correctly.


/netch

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010818122335.B399>