summaryrefslogtreecommitdiff
path: root/cic.c
diff options
context:
space:
mode:
authorJohn Vogel <jvogel4@stny.rr.com>2015-12-06 04:30:37 -0500
committerJohn Vogel <jvogel4@stny.rr.com>2015-12-06 04:30:37 -0500
commitfb3977503cd118abd95debee376141ea4079ddfb (patch)
tree7e74f6f7f62d22c4193268c066f95fb00e298f32 /cic.c
parent08b54647775a09c94cf32ae5eccd64c8661ce1f7 (diff)
downloadcic-fb3977503cd118abd95debee376141ea4079ddfb.tar.gz
Add a bare between view and input wins; fix scrolling.
Diffstat (limited to 'cic.c')
-rw-r--r--cic.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/cic.c b/cic.c
index c12d6df..6a11478 100644
--- a/cic.c
+++ b/cic.c
@@ -29,6 +29,7 @@ static char channel[256];
static time_t trespond;
static FILE *srv;
static WINDOW *viewwin;
+static WINDOW *barwin;
static WINDOW *inputwin;
static int rows;
static int cols;
@@ -44,19 +45,20 @@ pout(char *channel, char *fmt, ...) {
time_t t;
va_list ap;
- if (curline >= rows-2) {
- wscrl(viewwin, 4);
- curline -= 3;
+ /*if (curline == rows-3) {
+ wscrl(viewwin, 1);
+ curline -= 1;
}
else
- curline++;
+ curline++;*/
va_start(ap, fmt);
vsnprintf(bufout, sizeof bufout, fmt, ap);
va_end(ap);
t = time(NULL);
strftime(timestr, sizeof timestr, TIMESTAMP_FORMAT, localtime(&t));
- mvwprintw(viewwin, curline, 0, "%-12s: %s %s", channel, timestr, bufout);
+ wprintw(viewwin, "%-12s: %s %s\n", channel, timestr, bufout);
+ //mvwprintw(viewwin, curline, 0, "%-12s: %s %s", channel, timestr, bufout);
wrefresh(viewwin);
wrefresh(inputwin);
}
@@ -217,7 +219,7 @@ void gettermsize(void)
}
rows = w.ws_row;
cols = w.ws_col;
- wsetscrreg(viewwin, 0, rows-1);
+ wsetscrreg(viewwin, 0, rows-2);
}
void doresize(void)
@@ -231,12 +233,16 @@ void doresize(void)
if ((ch = getch()) != KEY_RESIZE)
ungetch(ch);
- wresize(viewwin, rows-1, cols);
+ wresize(viewwin, rows-2, cols);
wmove(viewwin, 0, 0);
+ wresize(barwin, 1, cols);
+ wmove(barwin, rows-2, 0);
+ whline(barwin, ACS_HLINE, cols);
wresize(inputwin, 1, cols);
wmove(inputwin, rows-1, 0);
wrefresh(viewwin);
+ wrefresh(barwin);
wrefresh(inputwin);
}
@@ -326,11 +332,14 @@ main(int argc, char *argv[]) {
gettermsize();
- viewwin = newwin(rows - 1, cols, 0, 0);
+ viewwin = newwin(rows - 2, cols, 0, 0);
idlok(viewwin, TRUE);
scrollok(viewwin, TRUE);
+ barwin = newwin(1, cols, rows - 2, 0);
+ whline(barwin, ACS_HLINE, cols);
inputwin = newwin(1, cols, rows - 1, 0);
wrefresh(viewwin);
+ wrefresh(barwin);
wrefresh(inputwin);
running = 1;
@@ -373,8 +382,7 @@ main(int argc, char *argv[]) {
parsein(bufin);
}
}
- delwin(viewwin);
- delwin(inputwin);
+
endwin();
return 0;
}