curs_border_set(3X)
β¨ curs_border_set β bestie, it's giving borders π
okay so this is a page from the 3X manual (that's the library-calls section, iykyk), and it's literally all about drawing borders and lines in a curses window β but with wide characters, which is the fancy complex-character version. no cap. π¦
π NAME π
border_set, wborder_set, box_set, hline_set, whline_set, mvhline_set, mvwhline_set, vline_set, wvline_set, mvvline_set, mvwvline_set β draw borders and lines in a curses window of wide characters π
π SYNOPSIS π
#include <curses.h>
int border_set(const cchar_t *ls, const cchar_t *rs,
const cchar_t *ts, const cchar_t *bs,
const cchar_t *tl, const cchar_t *tr,
const cchar_t *bl, const cchar_t *br);
int wborder_set(WINDOW *win,
const cchar_t *ls, const cchar_t *rs,
const cchar_t *ts, const cchar_t *bs,
const cchar_t *tl, const cchar_t *tr,
const cchar_t *bl, const cchar_t *br);
int box_set(WINDOW *win, const cchar_t *verch,
const cchar_t *horch);
int hline_set(const cchar_t *wch, int n);
int whline_set(WINDOW *win, const cchar_t *wch, int n);
int mvhline_set(int y, int x, const cchar_t *wch, int n);
int mvwhline_set(WINDOW *win, int y, int x,
const cchar_t *wch, int n);
int vline_set(const cchar_t *wch, int n);
int wvline_set(WINDOW *win, const cchar_t *wch, int n);
int mvvline_set(int y, int x, const cchar_t *wch, int n);
int mvwvline_set(WINDOW *win, int y, int x,
const cchar_t *wch, int n);
like yes bestie there are a LOT of them. it's a whole family. a whole friend group. π«Ά
π DESCRIPTION π
so. border_set and wborder_set draw a border around the edges of the current window or the specified window (that's the w one, obviously). the way these work: they do not change the cursor position, and they do not wrap. cursor stays exactly where it was. periodt. β¨
other than the window, every argument is a complex character β and it comes with attributes, okay, it's not just a plain char:
lsβ left sidersβ right sidetsβ top sidebsβ bottom sidetlβ top left-hand cornertrβ top right-hand cornerblβ bottom left-hand cornerbrβ bottom right-hand corner
now here's the cute part π if any of these arguments is zero, then the corresponding default values (defined in curses.h) get used instead. and the defaults are, in order:
WACS_VLINEWACS_VLINEWACS_HLINEWACS_HLINEWACS_ULCORNERWACS_URCORNERWACS_LLCORNERWACS_LRCORNER
(yes, WACS_VLINE shows up twice and WACS_HLINE shows up twice β that's literally how it is, don't come for me. π)
okay so box_set(win, verch, horch); is just a shorthand for this exact call, no thoughts:
wborder_set(win, verch, verch,
horch, horch, NULL, NULL, NULL, NULL);
slay, that's it. that's the whole shortcut. π
the *line_set functions use wch to draw a line starting at the current cursor position in the window. the line is at most n characters long, or as many as fit into the window β whichever comes first, bestie. and the current cursor position is not changed. nope. untouched. π
hline_set,mvhline_set,mvwhline_set, andwhline_setdraw a line proceeding toward the last column of the same line.vline_set,mvvline_set,mvwvline_set, andwvline_setdraw a line proceeding toward the last line of the window.
horizontal besties vs vertical besties. both iconic. π¦
π«Ά RETURN VALUE π«Ά
upon successful completion, these functions return OK. otherwise they return ERR. that's the whole vibe check right there.
- functions that take a window parameter return
ERRif it's null. (like, of course. you can't draw on a window that doesn't exist, bestie π) - functions prefixed with
mvfirst perform cursor movement, and they fail if the position(y, x)is outside the window boundaries. so watch those coordinates fr fr.
π NOTES π
border_set, hline_set, mvhline_set, mvvline_set, mvwhline_set, mvwvline_set, and vline_set may be implemented as macros.
okay so that means don't go taking their address or doing weird preprocessor shenanigans, because macro-ness is a thing here. lowkey important. π
π PORTABILITY π
X/Open Curses Issue 4 describes these functions. it specifies no error conditions for them. (so like, the spec just. didn't. the drama is ours to figure out β¨)
ποΈ HISTORY ποΈ
X/Open Curses Issue 4, back in 1995, initially specified these functions. so they're vintage, but like, vintage in a cute way. π
π SEE ALSO π
curses(3X)curs_add_wch(3X)curs_border(3X)curs_outopts(3X)
and that's the whole page, bestie!! go forth and draw gorgeous little boxes. this was ncurses 6.6, dated 2025-10-20, and it was called curs_border_set(3X) β mwah, obsessed, no notes πβ¨ππ¦π
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2019-2024,2025 Thomas E. Dickey
- Copyright 2002-2011,2012 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms