I've been testing ncurses, I tried doing a simple code using windows, by reading the code from the tutorials it seemed to me like calling wrefresh() was enough if changes were made just to one window. So I tried the following code, but it doesn't work, does anyone know why?
#include <ncurses.h> int main (void) { int ch; initscr(); raw(); keypad(stdscr, TRUE); noecho(); WINDOW *my_window = newwin(10, 20, 3, 4); box(my_window, 0, 0); wrefresh(my_window); while ((ch=getch()) != 'q'); endwin(); return 0; } If I add an extra call to refresh() before wrefresh() everything works fine.
#include <ncurses.h> int main (void) { int ch; initscr(); raw(); keypad(stdscr, TRUE); noecho(); WINDOW *my_window = newwin(10, 20, 3, 4); box(my_window, 0, 0); refresh(); wrefresh(my_window); while ((ch=getch()) != 'q'); endwin(); return 0; } I've tried several things, for instance calling refresh() after wrefresh() doesn't work either, using only refresh() also does not work. Also example 7 in this guide shows after calling refresh() once, it is enough to just call wrefresh() in the while loop.
Is it always mandatory to make a call to refresh() at least once after initscr()? the documentation does not seem to mention this.