Ok, i'm working on another simple ncurses program for a few friends and I. It's supposed to do this, in it's present state of being just a GUI-test (well, not exactly a GUI):
1) Show title at top -- it does this.
2) Create another window, below that, with a border. that window fills up the rest of the screen. --- this doens't work.
Here's the source.
Code:
#include <ncurses.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
int main(int argc, char *argv[]) {
WINDOW *win;
int curchar;
int height = (LINES - 5);
int width = (COLS - 3);
initscr();
cbreak();
keypad(stdscr, TRUE);
noecho();
start_color();
init_pair(1, COLOR_GREEN, COLOR_BLACK);
init_pair(2, COLOR_BLUE, COLOR_BLACK);
init_pair(3, COLOR_RED, COLOR_BLACK);
init_pair(4, COLOR_WHITE, COLOR_BLACK);
bkgdset(COLOR_BLACK);
attron(A_BOLD | COLOR_PAIR(1));
mvprintw(0, (COLS / 2) - (0.5 * strlen("SCSCO Communicator")), "SCSCO Communicator");
attroff(A_BOLD);
mvprintw(1, (COLS / 2) - (0.5 * strlen("By Cam Tenny")), "By Cam Tenny");
attroff(COLOR_PAIR(1));
win = newwin(height, width, 4, 1);
wborder(win, '|', '|', '-', '-', '*', '*', '*', '*');
wrefresh(stdscr);
wrefresh(win);
getch();
delwin(win);
endwin();
return 0;
}
compile with -lncurses, if you actually try to run it.