Ok, I know the question is old, but for the future reference: There is a way to get it to work.
After reading a tutorial about ncurses here http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO I was wondering how is it that if you printw()
and then getch()
you don't have to run refresh()
. I figured that it is invoked in getch()
and it refreshes stdscr
which overrides output from any other windows.
So in order to keep the window on screen and get keyboard input you have to use wgetch(WINDOW*)
.
Your code would look like that:
WINDOW *AboutWindow;
int width=60,height=12;
int OffsetX=0,OffsetY=0;
OffsetX = (getmaxx(stdscr) - width) / 2;
OffsetY = ((getmaxy(stdscr) - height) / 2);
AboutWindow = newwin(height, width, OffsetY, OffsetX);
box(AboutWindow, 0, 0);
wgetch(AboutWindow); //also invokes wrefresh()