gandi_init(3) - Linux man page

Name

GANDI_init, GANDI_initpairs

Synopsis

#include <gandi_core.h>

int GANDI_init();

void GANDI_initpairs();

Description

GANDI_init is often the first function you have to call. Unless you know what it does exactly, do not call any GANDI routine without first calling it. It initializes ncurses (with initscr(3NCURSES)) and initializes color pairs with GANDI_initpairs. Then it applies some attributes to the terminal and defines some system variables (GANDI_widget, GANDI_widgets, GANDI_actwidget, etc.).

GANDI_initpairs invokes start_color(3NCURSES) and assigns 64 color pairs. This function is called by GANDI_init automatically!

You can use 8 colors either for foreground or background:
Index Background Foreground
0 COLOR_BLACK COLOR_WHITE
1 COLOR_WHITE COLOR_RED
2 COLOR_RED COLOR_GREEN
3 COLOR_GREEN COLOR_YELLOW
4 COLOR_YELLOW COLOR_BLUE
5 COLOR_BLUE COLOR_MAGENTA
6 COLOR_MAGENTA COLOR_CYAN
7 COLOR_CYAN COLOR_BLACK

color_pair = foreground * 8 + background

Thus, if you want characters to be green on white, you'd use the 17-th pair.

Return Value

GANDI_initpairs returns no value.

GANDI_init returns ERR if initscr(3NCURSES) failed. Normally it returns OK.

Notes

See color(3NCURSES) for to learn color specifics.

See Also

gandi(3gandi), curs_initscr(3X), curs_color(3X)