diff options
author | James Booth <boothj5@gmail.com> | 2012-02-08 23:55:11 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2012-02-08 23:55:11 +0000 |
commit | c8bf654e2cd234bfd35ca97d6994b078b1b9b5ba (patch) | |
tree | 068ab93e8a581829237357a01d254dacf8a94dfb /input_bar.c | |
parent | a7190ed7e483c6791e8f05fd3564d31bd17c8cfa (diff) | |
download | profani-tty-c8bf654e2cd234bfd35ca97d6994b078b1b9b5ba.tar.gz |
Added seperate window modules
Diffstat (limited to 'input_bar.c')
-rw-r--r-- | input_bar.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/input_bar.c b/input_bar.c new file mode 100644 index 00000000..3d44e69b --- /dev/null +++ b/input_bar.c @@ -0,0 +1,36 @@ +#include <ncurses.h> +#include "windows.h" + +static WINDOW *inp_bar; + +void create_input_bar(void) +{ + int rows, cols; + getmaxyx(stdscr, rows, cols); + + inp_bar = newwin(1, cols, rows-2, 0); + wbkgd(inp_bar, COLOR_PAIR(3)); + wrefresh(inp_bar); +} + +void inp_bar_inactive(int win) +{ + mvwaddch(inp_bar, 0, 30 + win, ' '); + if (win == 9) + mvwaddch(inp_bar, 0, 30 + win + 1, ' '); + wrefresh(inp_bar); +} + +void inp_bar_active(int win) +{ + mvwprintw(inp_bar, 0, 30 + win, "%d", win+1); + touchwin(inp_bar); + wrefresh(inp_bar); +} + +void inp_bar_print_message(char *msg) +{ + mvwprintw(inp_bar, 0, 0, msg); + wrefresh(inp_bar); +} + |