7 static void finish(int sig);
9 int main(int argc, char *argv[])
11 /* initialize your non-curses data structures here */
14 signal(SIGINT, finish); /* arrange interrupts to terminate */
15 mainwin = initscr(); /* initialize the curses library */
16 keypad(stdscr, TRUE); /* enable keyboard mapping */
17 nonl(); /* tell curses not to do NL->CR/NL on output */
18 cbreak(); /* take input chars one at a time, no wait for \n */
19 noecho(); /* don't echo input */
23 /* Simple color assignment, often all we need. */
24 init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
25 init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
26 init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
27 init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
28 init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
29 init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
30 init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
31 init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
34 /* Ventana, caracter para linea vertical, caracter para linea horizontal*/
35 box(mainwin, ACS_VLINE, ACS_HLINE);
36 /* Ventana, Y, X, Texto */
37 mvwaddstr(mainwin, 10, 10, "Primer ejemplo!");
38 mvwaddstr(mainwin, 11, 10, "Una sola ventana de toda la terminal");
47 static void finish(int sig)
51 /* do your non-curses wrapup here */