On Mon, 18 Jan 2010 16:28:38 -0800, Gary Kline <kl...@thought.org> wrote:
>       ps: re Subject line, I remember it let you use /bin/sh without hittin
>       enter or <cr>.  there's no easy way of doing that in C!

In one line?

initscr(); cbreak(); noecho(); nonl(); intrflush(stdscr, FALSE); keypad(stdscr, 
TRUE); start_color();

:-)

The meaning of this "init dance" is explained in the manpage
of curs_inopts - "curses input options":

       cbreak, nocbreak, echo, noecho, halfdelay, intrflush, keypad, meta,
       nodelay, notimeout, raw, noraw, noqiflush, qiflush, timeout, wtimeout,
       typeahead

The start_color() function is mentioned in "man curs_color" and
is only needed if you want to use colors.

For shell scripts, the use of the dialog programs is a good
idea:

        #!/bin/sh
        DIALOG=${DIALOG=/usr/bin/dialog}

This is some kind of "init ncurses in one line". More
examples here: /usr/share/examples/dialog/



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to