curses init in one line?
Polytropon
freebsd at edvax.de
Tue Jan 19 15:52:21 UTC 2010
On Mon, 18 Jan 2010 16:28:38 -0800, Gary Kline <kline at 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, ...
More information about the freebsd-questions
mailing list