Re: curses init in one line?
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
Any curses gurus on this list? [Was:: {Re: curses init in one line?}]
On Sun, Jan 17, 2010 at 07:34:29PM -0800, Gary Kline wrote: I'm going round, round and round. chasing my tail trying to piece to gether a simple [ha!] test program that uses curses. Anybody out there who know how to fix an output cursor move()ment? Please write me off line. thnks, gary -- Gary Kline kl...@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 ___ 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
Re: curses init in one line?
On Sun, 17 Jan 2010 19:34:29 -0800, Gary Kline kl...@thought.org 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: /* curses_attributes_test.c (-lncurses required) */ #include curses.h 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, ... ___ 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
Re: curses init in one line?
On Mon, Jan 18, 2010 at 09:21:36PM +0100, Polytropon wrote: On Sun, 17 Jan 2010 19:34:29 -0800, Gary Kline kl...@thought.org 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 cr. there's no easy way of doing that in C! /* curses_attributes_test.c (-lncurses required) */ #include curses.h 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 kl...@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 ___ 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
curses init in one line?
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. I do not have it anywhere in my C files. gary PS: no, I am not sloshed [*hic*] -- Gary Kline kl...@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 ___ 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