I don't understand what function(s) to use to repaint the screen when the user presses Ctrl-L or Ctrl-R. What's the difference between using
If clearok is called with TRUE as argument, the next call to wrefresh with this window will clear the screen completely and redraw the entire screen from scratch. This is useful when the contents of the screen are uncertain, or in some cases for a more pleasing visual effect. If the win argument to clearok is the global variable curscr, the next call to wrefresh with any window causes the screen to be cleared and repainted from scratch.
If the win argument to wrefresh is the global variable curscr, the screen is immediately cleared and repainted from scratch.
The wredrawln routine indicates to curses that some screen lines are corrupted and should be thrown away before anything is written over them. It touches the indicated lines (marking them changed). The routine redrawwin() touches the entire window.
But those are different:
clearok(), you are not telling curses that you've lost track of what's on the screen, but saying that it's preferable to clear it (and curses will do that), but
redrawwin()isn't repainting the whole screen, but a window. Your application might do this if it is imitating the panel library, making some windows overlap and wanting to "raise" an obscured window above the others. Finally,
curscrexplicitly is telling curses to bypass the normal sequence of printing onto a window, or onto
stdscr, then applying changes from
newscr, and applying differences between
curscr. As far as curses is concerned,
curscrhas whatever is put onto the physical screen. So when you modify
curscr, curses updates the physical screen as soon as it is asked to refresh.
src/curses/resizwin.c: refresh curscr to force screen update in ncurses