From owner-freebsd-hackers Sat Aug 18 2:38:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by hub.freebsd.org (Postfix) with ESMTP id 6B67137B412 for ; Sat, 18 Aug 2001 02:38:13 -0700 (PDT) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id MOQ35770; Sat, 18 Aug 2001 12:38:04 +0300 (EEST) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.11.5/8.11.5) id f7I9NaG00850; Sat, 18 Aug 2001 12:23:36 +0300 (EEST) (envelope-from netch) Date: Sat, 18 Aug 2001 12:23:36 +0300 From: Valentin Nechayev To: Hans Zaunere Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: ncurses Message-ID: <20010818122335.B399@iv.nn.kiev.ua> References: <3B7B18EE.6B41ABED@math.missouri.edu> <20010816005744.24402.qmail@web12808.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010816005744.24402.qmail@web12808.mail.yahoo.com>; from zaunere@yahoo.com on Wed, Aug 15, 2001 at 05:57:44PM -0700 X-42: On Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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