mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-18 03:25:55 +00:00
demo: destroy debug window at end #1569
This commit is contained in:
parent
a38ccc4025
commit
31ee680ea8
@ -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…
Reference in New Issue
Block a user