notcurses_progbar(3)
π notcurses_progbar: high level widget for progress bars π
okay bestie, welcome to the notcurses_progbar manual page β yes, the manual name is literally notcurses_progbar, and this is the high-level widget for progress bars. itβs giving βI draw bars in four directionsβ energy, no cap. π«Ά
πΈ NAME πΈ
notcurses_progbar β high level widget for progress bars π
β¨ SYNOPSIS β¨
#include <notcurses/notcurses.h>
struct ncprogbar;
#define NCPROGBAR_OPTION_RETROGRADE 0x0001u // proceed left/down
typedef struct ncprogbar_options {
uint32_t ulchannel; // upper-left channel. in the context of a progress bar,
uint32_t urchannel; // "up" is the direction we are progressing towards, and
uint32_t blchannel; // "bottom" is the direction of origin. for monochromatic
uint32_t brchannel; // bar, all four channels ought be the same.
uint64_t flags;
} ncprogbar_options;
struct ncprogbar* ncprogbar_create(struct ncplane* n, const
ncprogbar_options* opts)
struct ncplane* ncprogbar_plane(struct ncprogbar* n)
int ncprogbar_set_progress(struct ncprogbar* n, double p)
double ncprogbar_progress(const struct ncprogbar* n)
void ncprogbar_destroy(struct ncprogbar* n)
the one flag rn is NCPROGBAR_OPTION_RETROGRADE (0x0001u) β proceed left/down π
π¦ DESCRIPTION π¦
these functions draw progress bars in any of four directions. the progress measure is a double between zero and one, inclusive, provided to ncprogbar_set_progress. this will be scaled to the size of the provided ncplane n. the axis of progression is the longer element of the planeβs geometry. horizontal bars proceed to the right by default, and vertical bars proceed up. this can be changed with NCPROGBAR_OPTION_RETROGRADE. periodt. π«
π NOTES π
ncprogbar_create takes ownership of n in all cases. on failure, n will be destroyed immediately. it is otherwise destroyed by ncprogbar_destroy. so yeah, bestie, the ownership rules are not playing around π«‘π
β RETURN VALUES β
ncprogbar_planereturns thencplaneon which the progress bar is drawn. πncprogbar_progressreturns the current progress, a value between zero and one, inclusive. they cannot fail. β¨ncprogbar_set_progressreturns-1ifpis less than zero or greater than one, or if there is an internal error redrawing the progress bar. it returns0otherwise. π―
π BUGS π
whether progression is to the left or right by default probably ought be an aspect of the current locale. likeβ¦ locale said βvibesβ and left it at that, apparently π
π SEE ALSO π
π AUTHORS π
nick black nickblack@linux.com π
xoxo, your notcurses v2.0.11 bestie β page notcurses_progbar(3) out π
π¦ where this page comes from
- alpine 3.24: notcurses-doc 3.0.17-r0 Β· Apache-2.0
- ubuntu resolute: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- ubuntu stonking: libnotcurses-core-dev 3.0.17+dfsg-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms