gandi_widget(3) - Linux man page

Name

Routines for work with widgets.

Synopsis

#include <gandi_core.h>

void *GANDI_get_Nchild(void *w, size_t index);

PANEL *GANDI_get_Npanel(void *w, size_t index);

WINDOW *GANDI_get_Nwindow(void *w, size_t index);

int GANDI_getbegx(void *w);

int GANDI_getbegx_border(void *w);

int GANDI_getbegy(void *w);

int GANDI_getbegy_border(void *w);

void GANDI_getbegyx(void *w, int y, int x);

void GANDI_getbegyx_border(void *w, int y, int x);

int GANDI_getborder(void *w);

int GANDI_getmaxx(void *w);

int GANDI_getmaxx_border(void *w);

int GANDI_getmaxy(void *w);

int GANDI_getmaxy_border(void *w);

void GANDI_getmaxyx(void *w, int y, int x);

void GANDI_getmaxyx_border(void *w, int y, int x);

void GANDI_kill_emptywidget(void *ws);

void *GANDI_make_emptywidget(size_t size, int nlines, int ncols, int by, int bx, void *parent, size_t wnum, void *dfl);

Description

void *GANDI_get_Nchild(void *w, size_t index);

PANEL *GANDI_get_Npanel(void *w, size_t index);

WINDOW *GANDI_get_Nwindow(void *w, size_t index);

In these three macroses the index refer to the requested object (e.g. child). There is no checking on index validation at all!

int GANDI_getbegx(void *w);

int GANDI_getbegy(void *w);

void GANDI_getbegyx(void *w, int y, int x);

int GANDI_getmaxx(void *w);

int GANDI_getmaxy(void *w);

void GANDI_getmaxyx(void *w, int y, int x);

These are the ncurses' macroses prototypes (see getyx(3NCURSES)). They have a similiar interface but with void * instead of WINDOW *. The returning (or storing) values relates to the widget's work area without a border. There is _border suffix for all of these functions, which will do the same thing but with a border.

int GANDI_getborder(void *w);

This simple macro returns either 1 if the widget has a border or 0 otherwise.

void GANDI_kill_emptywidget(void *ws);

Removes the widget from register and frees its allocated memory (which is known by the core). This function deletes all widget's panels as well. Afterwards ws will not point to the allocated memory.

void GANDI_kill_widget(void w);

Runs the widget's kill action handler (see gandi_acts(3gandi)). Kills all widget's children and finalize operation with GANDI_kill_emptywidget.

void *GANDI_make_emptywidget(size_t size, int nlines, int ncols, int by, int bx, void *parent, size_t wnum, void *dfl);

Creates a new widget with size (nlines;ncols) at the position (by;bx), owned by the parent. The widget will have size allocated bytes (sizeof(GANDI_widget *) is a minimum). wnum ncurses' panels (see panel(3CURSES)) and their associated windows (see ncurses(3NCURSES)) will be created. *dfl is a structure which will be copied to the newly created widget. *dfl contains default initial data (e.g. rows_min, rows_max) for the widget. If dfl is NULL the GANDI_stndrwidget will be applied (see gandi_stndr(3gandi)).

On success a new widget will be returned. Otherwise - NULL.

See Also

getyx(3NCURSES) gandi_core(3gandi) gandi_stndr(3gandi) ncurses(3NCURSES) panel(3CURSES)