2020-01-30 13:55:01 +00:00
|
|
|
% notcurses_selector(3)
|
|
|
|
% nick black <nickblack@linux.com>
|
2020-02-24 05:03:00 +00:00
|
|
|
% v1.2.2
|
2020-01-30 13:55:01 +00:00
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
|
|
|
notcurses_selector - high level widget for selecting from a set
|
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
|
|
|
**#include <notcurses.h>**
|
|
|
|
|
|
|
|
```c
|
2020-02-11 01:22:23 +00:00
|
|
|
**struct ncinput;**
|
|
|
|
**struct ncplane;**
|
|
|
|
**struct notcurses;**
|
|
|
|
**struct ncselector;**
|
|
|
|
|
2020-01-31 22:44:30 +00:00
|
|
|
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
|
2020-02-01 02:25:21 +00:00
|
|
|
uint64_t bgchannels; // background channels for body
|
2020-01-31 22:44:30 +00:00
|
|
|
} selector_options;
|
2020-01-30 13:55:01 +00:00
|
|
|
```
|
|
|
|
|
2020-01-31 22:44:30 +00:00
|
|
|
**struct ncselector* ncselector_create(struct ncplane* n, int y, int x, const selector_options* opts);**
|
|
|
|
|
|
|
|
**int ncselector_additem(struct ncselector* n, const struct selector_item* item);**
|
|
|
|
|
|
|
|
**int ncselector_delitem(struct ncselector* n, const char* item);**
|
|
|
|
|
2020-02-12 14:11:28 +00:00
|
|
|
**const char* ncselector_selected(const struct ncselector* n);**
|
2020-01-31 22:44:30 +00:00
|
|
|
|
|
|
|
**struct ncplane* ncselector_plane(struct ncselector* n);**
|
|
|
|
|
2020-02-12 14:11:28 +00:00
|
|
|
**const char* ncselector_previtem(struct ncselector* n);**
|
2020-01-31 22:44:30 +00:00
|
|
|
|
2020-02-12 14:11:28 +00:00
|
|
|
**const char* ncselector_nextitem(struct ncselector* n);**
|
2020-01-31 22:44:30 +00:00
|
|
|
|
2020-02-11 01:22:23 +00:00
|
|
|
**bool ncselector_offer_input(struct ncselector* n, const struct ncinput* nc);**
|
|
|
|
|
2020-02-01 07:31:05 +00:00
|
|
|
**void ncselector_destroy(struct ncselector* n, char\*\* item);**
|
2020-01-31 22:44:30 +00:00
|
|
|
|
2020-01-30 13:55:01 +00:00
|
|
|
# DESCRIPTION
|
|
|
|
|
|
|
|
# NOTES
|
|
|
|
|
|
|
|
# RETURN VALUES
|
|
|
|
|
|
|
|
# SEE ALSO
|
|
|
|
|
2020-02-11 01:22:23 +00:00
|
|
|
**notcurses(3)**,
|
|
|
|
**notcurses_input(3)**,
|
|
|
|
**notcurses_ncplane(3)**
|