From owner-freebsd-questions@FreeBSD.ORG Tue Jan 19 00:28:47 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C60F71065672 for ; Tue, 19 Jan 2010 00:28:47 +0000 (UTC) (envelope-from kline@thought.org) Received: from ethic.thought.org (plato.thought.org [209.180.213.209]) by mx1.freebsd.org (Postfix) with ESMTP id 691EF8FC16 for ; Tue, 19 Jan 2010 00:28:47 +0000 (UTC) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by ethic.thought.org (8.14.3/8.14.3) with ESMTP id o0J0Scka089630; Mon, 18 Jan 2010 16:28:39 -0800 (PST) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Mon, 18 Jan 2010 16:28:39 -0800 (PST) Date: Mon, 18 Jan 2010 16:28:38 -0800 From: Gary Kline To: Polytropon Message-ID: <20100119002838.GB11545@thought.org> References: <20100118033426.GA7585@thought.org> <20100118212136.95b56398.freebsd@edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100118212136.95b56398.freebsd@edvax.de> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 23 years of service to the Unix community. X-Spam-Status: No, score=-0.6 required=3.6 tests=ALL_TRUSTED,BAYES_00, FH_DATE_PAST_20XX,J_CHICKENPOX_66 autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ethic.thought.org Cc: FreeBSD Mailing List Subject: Re: curses init in one line? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jan 2010 00:28:47 -0000 On Mon, Jan 18, 2010 at 09:21:36PM +0100, Polytropon wrote: > On Sun, 17 Jan 2010 19:34:29 -0800, Gary Kline wrote: > > > > this is going to sound a bit off the wall, and it may have only worked > > in FBSD [if I wasn't imagining it], but is there a way to get into > > curses/ncurses mode in one short line? it has been years but I think > > somebody sent me the magic code, for either a shell scrippt or a C > > program. > > It's quite easy, let me demonstrate it with this > example program: > Whoa, cool, man, thanks. I'll print this out to save. a number wrote off list and I may pick one or two and see if they have a clue why my output isn't jibing with what I want..... gary ps: re Subject line, I remember it let you use /bin/sh without hittin enter or . there's no easy way of doing that in C! > > /* curses_attributes_test.c (-lncurses required) */ > > #include > > int main(void) > { > initscr(); > cbreak(); > noecho(); > nonl(); > intrflush(stdscr, FALSE); > keypad(stdscr, TRUE); > start_color(); > > > attrset(A_NORMAL); > printw("Normal display (no highlight)\n"); > printw("\n"); > > attrset(A_STANDOUT); > printw("Best highlighting mode of the terminal.\n"); > printw("\n"); > > attrset(A_UNDERLINE); > printw("Underlining\n"); > printw("\n"); > > attrset(A_REVERSE); > printw("Reverse video\n"); > printw("\n"); > > attrset(A_BLINK); > printw("Blinking\n"); > printw("\n"); > > attrset(A_DIM); > printw("Half bright\n"); > printw("\n"); > > attrset(A_BOLD); > printw("Extra bright or bold\n"); > printw("\n"); > > refresh(); > > return 0; > } > > The initsrc() funtion is the key. > > > > > I do not have it anywhere in my C files. > > But in the manpage. :-) > > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 7.79a release of Jottings: http://jottings.thought.org/index.php