--- /dev/null
+
+#include <curses.h>
+#include <signal.h>
+#include <panel.h>
+
+static void finish(int sig);
+
+int main(int argc, char *argv[])
+{
+ /* initialize your non-curses data structures here */
+ WINDOW *mainwin;
+
+ signal(SIGINT, finish); /* arrange interrupts to terminate */
+ mainwin = initscr(); /* initialize the curses library */
+ keypad(stdscr, TRUE); /* enable keyboard mapping */
+ nonl(); /* tell curses not to do NL->CR/NL on output */
+ cbreak(); /* take input chars one at a time, no wait for \n */
+ noecho(); /* don't echo input */
+
+ if (has_colors()) {
+ start_color();
+ /* Simple color assignment, often all we need. */
+ init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
+ init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
+ init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
+ init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
+ init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
+ init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
+ init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
+ init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
+ }
+
+ /* Ventana, caracter para linea vertical, caracter para linea horizontal*/
+ box(mainwin, ACS_VLINE, ACS_HLINE);
+ /* Ventana, Y, X, Texto */
+ mvwaddstr(mainwin, 10, 10, "Primer ejemplo!");
+ mvwaddstr(mainwin, 11, 10, "Una sola ventana de toda la terminal");
+
+ getch();
+
+ delwin(mainwin);
+ endwin();
+ return 0;
+}
+
+static void finish(int sig)
+{
+ endwin();
+
+ /* do your non-curses wrapup here */
+
+ exit(0);
+}
+
--- /dev/null
+
+#include <curses.h>
+#include <signal.h>
+#include <panel.h>
+
+static void finish(int sig);
+
+int main(int argc, char *argv[])
+{
+ /* initialize your non-curses data structures here */
+ WINDOW *mainwin, *otra;
+
+ signal(SIGINT, finish); /* arrange interrupts to terminate */
+ mainwin = initscr(); /* initialize the curses library */
+ keypad(stdscr, TRUE); /* enable keyboard mapping */
+ nonl(); /* tell curses not to do NL->CR/NL on output */
+ cbreak(); /* take input chars one at a time, no wait for \n */
+ noecho(); /* don't echo input */
+
+ if (has_colors()) {
+ start_color();
+ /* Simple color assignment, often all we need. */
+ init_pair(COLOR_BLACK, COLOR_BLACK, COLOR_BLACK);
+ init_pair(COLOR_GREEN, COLOR_GREEN, COLOR_BLACK);
+ init_pair(COLOR_RED, COLOR_RED, COLOR_BLACK);
+ init_pair(COLOR_CYAN, COLOR_CYAN, COLOR_BLACK);
+ init_pair(COLOR_WHITE, COLOR_WHITE, COLOR_BLACK);
+ init_pair(COLOR_MAGENTA, COLOR_MAGENTA, COLOR_BLACK);
+ init_pair(COLOR_BLUE, COLOR_BLUE, COLOR_BLACK);
+ init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK);
+ }
+
+ /* Ventana, caracter para linea vertical, caracter para linea horizontal*/
+ box(mainwin, ACS_VLINE, ACS_HLINE);
+ /* Ventana, Y, X, Texto */
+ mvwaddstr(mainwin, 3, 10, "Segundo Ejemplo!");
+ mvwaddstr(mainwin, 4, 10, "Ventana Principal, Ocupa todo el terminal");
+
+ /* Creo una subventana! */
+ otra = subwin(mainwin, 10, 10, 8, 20);
+ mvwaddstr(otra, 1, 1, "Esto es otra ventana (sin borde)");
+
+ refresh();
+
+ getch();
+
+ delwin(otra);
+ delwin(mainwin);
+ endwin();
+ return 0;
+}
+
+static void finish(int sig)
+{
+ endwin();
+
+ /* do your non-curses wrapup here */
+
+ exit(0);
+}
+