NCurses Refresh

前端 未结 2 1145
醉话见心
醉话见心 2020-12-10 04:36

I have a small ncurse program I\'m running, but the output doesn\'t seem to show up unless I stick the wrefresh() in a while loop.

Is there some buffer

相关标签:
2条回答
  • 2020-12-10 05:25

    That's working as designed. That allows you to completely redraw your next screen but only the parts that actually changed get sent to the terminal at refresh time. This isn't such a big deal these days but made a big difference when terminal connections were relatively slow.

    0 讨论(0)
  • 2020-12-10 05:29

    You are not supposed to mix operations on stdscr and windows created with newwin(). getch() operates on stdscr, so that is your problem. Replace that call with

    wgetch(win);
    

    (getch() is causing stdscr to be dumped over the top of your other window, and because that happens so quickly it looks like the other window never got displayed at all).

    0 讨论(0)
提交回复
热议问题