|
NAMEnotcurses_multiselector - high level widget for selecting from a setSYNOPSIS#include <notcurses/notcurses.h>
struct ncmultiselector* ncmultiselector_create(struct ncplane* n, const ncmultiselector_options* opts); int ncmultiselector_selected(bool* selected, unsigned n); struct ncplane* ncmultiselector_plane(struct ncmultiselector* n); bool ncmultiselector_offer_input(struct ncmultiselector* n, const ncinput* nc); void ncmultiselector_destroy(struct ncmultiselector* n); DESCRIPTIONA multiselector widget presents a list of items (possibly more than can be displayed at once). It facilitates a choice of zero, one, or multiple items from the list. Items can be selected and deselected before a final choice is made.NOTESThe ncplane n provided to ncmultiselector_create must not be NULL. It will be freely resized by the new ncmultiselector.ncmultiselector_selected returns the index of the option currently highlighted. It stores to the n-ary bitmap pointed to by selected based on the currently-selected options. ncmultiselector_plane will return the ncplane on which the widget is drawn. Input should be run through ncmultiselector_offer_input to take advantage of common controls. It will handle the up and down arrows, along with PageUp and PageDown. If the mouse is enabled, the mouse scrollwheel and mouse clicks on the scroll arrows will be handled. ncmultiselector_destroy destroys the backing ncplane, as does ncmultiselector_create in the event of any error. RETURN VALUESncmultiselector_create returns NULL on an error, in which case the passed ncplane is destroyed.ncmultiselector_selected returns -1 if there are no items, or if n is not equal to the number of items. It otherwise returns the index of the currently highlighted option, and writes a bitmap to selected based off the selected items. SEE ALSOnotcurses(3), notcurses_input(3), notcurses_plane(3) notcurses_selector(3)AUTHORSnick black <nickblack@linux.com>.
Visit the GSP FreeBSD Man Page Interface. |