mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
poc/menu: kill brown-bagger, add backgrounds #383
This commit is contained in:
parent
c9a0964034
commit
773b85e81e
@ -13,7 +13,7 @@
|
||||
* Repack DFSG-safe tarball, upload to github
|
||||
* download github-spun tarball
|
||||
* remove nonfree multimedia:
|
||||
* rm data/chun* data/[deflmPw]* src/demo/jungle.c
|
||||
* rm data/chun* data/[adeflmPw]* src/demo/jungle.c
|
||||
* `tar -cJf ../v$VERSION.dfsg.tar.xz -C.. notcurses-$VERSION`
|
||||
* upload to github
|
||||
* Build new Debian package
|
||||
|
@ -58,6 +58,7 @@ run_menu(struct notcurses* nc, struct ncmenu* ncm){
|
||||
notcurses_render(nc);
|
||||
}
|
||||
ncmenu_destroy(ncm);
|
||||
return 0;
|
||||
|
||||
err:
|
||||
ncplane_destroy(selplane);
|
||||
@ -109,10 +110,22 @@ int main(void){
|
||||
if(top == NULL){
|
||||
goto err;
|
||||
}
|
||||
|
||||
struct ncplane* n = notcurses_stdplane(nc);
|
||||
int dimy, dimx;
|
||||
ncplane_dim_yx(n, &dimy, &dimx);
|
||||
struct ncplane* n = notcurses_stddim_yx(nc, &dimy, &dimx);
|
||||
|
||||
int averr;
|
||||
|
||||
struct ncvisual* ncv = ncplane_visual_open(n, "../data/ebolavirus_wide-0723bc3f01c644976b4df7e146a1d795aaf9d55e.jpg", &averr);
|
||||
if(!ncv){
|
||||
goto err;
|
||||
}
|
||||
if(!ncvisual_decode(ncv, &averr)){
|
||||
goto err;
|
||||
}
|
||||
if(ncvisual_render(ncv, 0, 0, 0, 0)){
|
||||
goto err;
|
||||
}
|
||||
|
||||
uint64_t channels = 0;
|
||||
channels_set_fg(&channels, 0x88aa00);
|
||||
channels_set_bg(&channels, 0x000088);
|
||||
@ -128,6 +141,19 @@ int main(void){
|
||||
run_menu(nc, top);
|
||||
|
||||
ncplane_erase(n);
|
||||
ncvisual_destroy(ncv);
|
||||
|
||||
ncv = ncplane_visual_open(n, "../data/aidsrobots.jpeg", &averr);
|
||||
if(!ncv){
|
||||
goto err;
|
||||
}
|
||||
if(!ncvisual_decode(ncv, &averr)){
|
||||
goto err;
|
||||
}
|
||||
if(ncvisual_render(ncv, 0, 0, 0, 0)){
|
||||
goto err;
|
||||
}
|
||||
|
||||
mopts.bottom = true;
|
||||
struct ncmenu* bottom = ncmenu_create(nc, &mopts);
|
||||
if(bottom == NULL){
|
||||
@ -136,8 +162,9 @@ int main(void){
|
||||
if(ncplane_putstr_aligned(n, 0, NCALIGN_RIGHT, " -=+ menu poc. press q to exit +=- ") < 0){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
run_menu(nc, top);
|
||||
run_menu(nc, bottom);
|
||||
|
||||
ncvisual_destroy(ncv);
|
||||
if(notcurses_stop(nc)){
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user