fileroller/procroller: use alternate screen

dankamongmen/ltr
nick black 4 years ago
parent 03c95b2b14
commit 564fcafee3
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -2,7 +2,7 @@
static void
ncpile_debug(const ncpile* p, FILE* debugfp){
fprintf(debugfp, " -=+********************** %16p pile *************************+=-\n", p);
fprintf(debugfp, " ************************* %16p pile ****************************\n", p);
const ncplane* n = p->top;
const ncplane* prev = NULL;
int planeidx = 0;
@ -33,7 +33,7 @@ ncpile_debug(const ncpile* p, FILE* debugfp){
void notcurses_debug(notcurses* nc, FILE* debugfp){
const ncpile* p = ncplane_pile(nc->stdplane);
fprintf(debugfp, " ************************** notcurses debug state *****************************\n");
fprintf(debugfp, " -------------------------- notcurses debug state -----------------------------\n");
const ncpile* p0 = p;
do{
ncpile_debug(p0, debugfp);
@ -43,5 +43,5 @@ void notcurses_debug(notcurses* nc, FILE* debugfp){
fprintf(stderr, "WARNING: expected ->prev %p, got %p\n", prev, p0->prev);
}
}while(p != p0);
fprintf(debugfp, " ******************************************************************************\n");
fprintf(debugfp, " ______________________________________________________________________________\n");
}

@ -42,7 +42,7 @@ int main(int argc, char** argv){
}
setlocale(LC_ALL, "");
notcurses_options opts = {
.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN |
.flags = NCOPTION_INHIBIT_SETLOCALE |
NCOPTION_SUPPRESS_BANNERS,
};
struct notcurses* nc = notcurses_init(&opts, NULL);
@ -66,6 +66,10 @@ int main(int argc, char** argv){
notcurses_stop(nc);
return EXIT_FAILURE;
}
ncplane_set_fg_rgb(n, 0x00bcaa);
ncplane_printf_aligned(n, -1, NCALIGN_CENTER, "press any key to continue (%s)", *argv);
notcurses_render(nc);
notcurses_getc(nc, NULL, NULL, NULL);
}
done:

@ -43,7 +43,7 @@ int main(int argc, char** argv){
}
setlocale(LC_ALL, "");
notcurses_options opts = {
.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN |
.flags = NCOPTION_INHIBIT_SETLOCALE |
NCOPTION_SUPPRESS_BANNERS,
};
struct notcurses* nc = notcurses_init(&opts, NULL);
@ -69,6 +69,10 @@ int main(int argc, char** argv){
notcurses_stop(nc);
return EXIT_FAILURE;
}
ncplane_set_fg_rgb(std, 0x00bcaa);
ncplane_printf_aligned(std, -1, NCALIGN_CENTER, "press any key to continue (%s)", *argv);
notcurses_render(nc);
notcurses_getc(nc, NULL, NULL, NULL);
if(notcurses_stop(nc)){
return EXIT_FAILURE;
}

Loading…
Cancel
Save