开发者

Does endwin() de-initialize ncurses?

开发者 https://www.devze.com 2022-12-15 04:20 出处:网络
I am using the ncurses library 开发者_开发问答to show some funny output on the screen, but in the middle of the program I need to temporarily exit ncurses mode. I call endwin(), after which my program

I am using the ncurses library 开发者_开发问答to show some funny output on the screen, but in the middle of the program I need to temporarily exit ncurses mode. I call endwin(), after which my program should be able to use printf() to show a menu to the user. Unluckily, my program was unable to show the menu. I tried using fflush() after printf(), and only then is it able to show the menu on the screen.

Can anyone tell me why, after I call endwin(), the terminal can't return to normal and I'm unable to use printf()?


Use def_prog_mode prior to endwin to save state. After returning, do: reset_prog_mode and then refresh. Your original screen will be shown.

Yes, after using printf you have to do: fflush(stdout).

0

精彩评论

暂无评论...
验证码 换一张
取 消