From 741761787f20ce8a9961dddf6816453bbcb44dae Mon Sep 17 00:00:00 2001 From: nick black Date: Fri, 31 Jan 2020 17:44:30 -0500 Subject: [PATCH] notcurses_selector(3) man page #302 --- doc/man/man3/notcurses_selector.3.md | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/doc/man/man3/notcurses_selector.3.md b/doc/man/man3/notcurses_selector.3.md index 71b9d2d54..88aa4554b 100644 --- a/doc/man/man3/notcurses_selector.3.md +++ b/doc/man/man3/notcurses_selector.3.md @@ -11,8 +11,52 @@ notcurses_selector - high level widget for selecting from a set **#include ** ```c +struct selector_item { + char* option; + char* desc; +}; + +typedef struct selector_options { + char* title; // title may be NULL, inhibiting riser + char* secondary; // secondary may be NULL + char* footer; // footer may be NULL + struct selector_item* items; // initial items and descriptions + unsigned itemcount; // number of initial items and descriptions + // default item (selected at start) + unsigned defidx; + // maximum number of options to display at once + unsigned maxdisplay; + // exhaustive styling options + uint64_t opchannels; // option channels + uint64_t descchannels; // description channels + uint64_t titlechannels;// title channels + uint64_t footchannels; // secondary and footer channels + uint64_t boxchannels; // border channels + uint64_t bgchannels; // base cell channels + const char* base_egc; // base EGC or NULL +} selector_options; ``` +**struct ncselector;** + +**struct ncselector* ncselector_create(struct ncplane* n, int y, int x, const selector_options* opts);** + +**struct ncselector* ncselector_aligned(struct ncplane* n, int y, ncalign_e align, const selector_options* opts);** + +**int ncselector_additem(struct ncselector* n, const struct selector_item* item);** + +**int ncselector_delitem(struct ncselector* n, const char* item);** + +**char* ncselector_selected(const struct ncselector* n);** + +**struct ncplane* ncselector_plane(struct ncselector* n);** + +**void ncselector_previtem(struct ncselector* n, char** newitem);** + +**void ncselector_nextitem(struct ncselector* n, char** newitem);** + +**void ncselector_destroy(struct ncselector* n, char** item);** + # DESCRIPTION # NOTES