demo: destroy debug window at end #1569

pull/1573/head
nick black 3 years ago
parent a38ccc4025
commit 31ee680ea8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -589,7 +589,7 @@ int main(int argc, char** argv){
if(fpsgraph_stop()){
goto err;
}
about_destroy(nc);
about_destroy(nc); // also kills debug window
}while(restart_demos);
ncmenu_destroy(menu);
stop_input();

@ -101,8 +101,7 @@ debug_toggle(struct notcurses* nc){
.y = 3,
.x = NCALIGN_CENTER,
.rows = count_debug_lines(output, outputlen) + 1,
// 1 plus the max len of debug output so it can print against right border
.cols = 81,
.cols = 80,
.flags = NCPLANE_OPTION_HORALIGNED,
};
struct ncplane* n = ncplane_create(notcurses_stdplane(nc), &nopts);
@ -184,10 +183,14 @@ about_toggle(struct notcurses* nc){
ncplane_destroy(n);
}
// kills about window *and* debug window
void about_destroy(struct notcurses* nc){
if(about){
about_toggle(nc);
}
if(debug){
debug_toggle(nc);
}
}
static void

@ -32,7 +32,7 @@ visualize(struct notcurses* nc, struct ncvisual* ncv){
vopts.x = NCALIGN_CENTER;
vopts.y = NCALIGN_CENTER;
//fprintf(stderr, "X: %d truex: %d scalex: %d\n", vopts.x, truex, scalex);
ncplane_erase(stdn);
ncplane_erase(stdn); // to clear out old text
struct ncplane* n;
if((n = ncvisual_render(nc, ncv, &vopts)) == NULL){
ncplane_printf_aligned(stdn, ncplane_dim_y(stdn) / 2 - 1, NCALIGN_CENTER, "not available");

Loading…
Cancel
Save