mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
selector PoC: ncplane_new -> ncplane_create #1115
This commit is contained in:
parent
4a5fb14bc1
commit
0215f9482b
@ -98,20 +98,30 @@ int main(void){
|
||||
|
||||
ncplane_set_fg_rgb(n, 0x40f040);
|
||||
ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, "selector widget demo");
|
||||
struct ncplane* seln = ncplane_new(n, 1, 1, 3, 0, NULL, NULL);
|
||||
struct ncplane_options nopts = {
|
||||
.y = 3,
|
||||
.horiz = { .x = 0, },
|
||||
.rows = 1,
|
||||
.cols = 1,
|
||||
.userptr = NULL,
|
||||
.name = NULL,
|
||||
.resizecb = NULL,
|
||||
.flags = 0,
|
||||
};
|
||||
struct ncplane* seln = ncplane_create(n, &nopts);
|
||||
ncplane_set_base(seln, "", 0, bgchannels);
|
||||
struct ncselector* ns = ncselector_create(seln, &sopts);
|
||||
run_selector(nc, ns);
|
||||
|
||||
sopts.title = "short round title";
|
||||
seln = ncplane_new(n, 1, 1, 3, 0, NULL, NULL);
|
||||
seln = ncplane_create(n, &nopts);
|
||||
ncplane_set_base(seln, "", 0, bgchannels);
|
||||
ns = ncselector_create(seln, &sopts);
|
||||
run_selector(nc, ns);
|
||||
|
||||
sopts.title = "short round title";
|
||||
sopts.secondary = "now this secondary is also very, very, very outlandishly long, you see";
|
||||
seln = ncplane_new(n, 1, 1, 3, 0, NULL, NULL);
|
||||
seln = ncplane_create(n, &nopts);
|
||||
ncplane_set_base(seln, "", 0, bgchannels);
|
||||
ns = ncselector_create(seln, &sopts);
|
||||
run_selector(nc, ns);
|
||||
@ -119,7 +129,7 @@ int main(void){
|
||||
sopts.title = "the whole world is watching";
|
||||
sopts.secondary = NULL;
|
||||
sopts.footer = "now this FOOTERFOOTER is also very, very, very outlandishly long, you see";
|
||||
seln = ncplane_new(n, 1, 1, 3, 0, NULL, NULL);
|
||||
seln = ncplane_create(n, &nopts);
|
||||
ncplane_set_base(seln, "", 0, bgchannels);
|
||||
ns = ncselector_create(seln, &sopts);
|
||||
run_selector(nc, ns);
|
||||
@ -127,7 +137,7 @@ int main(void){
|
||||
sopts.title = "chomps";
|
||||
sopts.secondary = NULL;
|
||||
sopts.footer = NULL;
|
||||
seln = ncplane_new(n, 1, 1, 3, 0, NULL, NULL);
|
||||
seln = ncplane_create(n, &nopts);
|
||||
ncplane_set_base(seln, "", 0, bgchannels);
|
||||
ns = ncselector_create(seln, &sopts);
|
||||
run_selector(nc, ns);
|
||||
|
Loading…
x
Reference in New Issue
Block a user