2
* txbox.c - custom window bordering routine for ncurses windows.
4
* Copyright (c) Gerard Paul Java 2002
6
* This function is written to address a strange symptom in ncurses 5.2, at
7
*least on RedHat 7.3. The border drawn by the box() macro (actually an alias
8
* for a call to wborder()) no longer uses the color attributes set by
9
* wattrset(). However, the addch() and wvline() functions still do.
11
* The tx_box function is a drop-in replacement for box().
16
void tx_box(WINDOW *win, int vline, int hline)
23
getmaxyx(win, winheight, winwidth);
27
mvwaddch(win, 0, 0, ACS_ULCORNER);
28
mvwhline(win, 0, 1, hline, winwidth - 1);
29
mvwaddch(win, 0, winwidth, ACS_URCORNER);
31
for (i = 1; i < winheight; i++) {
32
mvwaddch(win, i, 0, vline);
33
mvwaddch(win, i, winwidth, vline);
36
mvwaddch(win, winheight, 0, ACS_LLCORNER);
37
mvwhline(win, winheight, 1, hline, winwidth - 1);
38
mvwaddch(win, winheight, winwidth, ACS_LRCORNER);