我创建了一个与其他窗口重叠的弹出窗口,我对其进行了更改,然后将其删除。但是当我这样做时,背景窗口会保留空白。
popup(){
WINDOW* backgroundWin = subwin(stdscr,0,0,100,100);
//fill it with something
WINDOW* popupWin = subwin(stdscr,50,50,10,10);
werase(popupWin); //so it doesn't look 'transparent'
box(popupWin,0,0);
wrefresh(popupWin);
getch();
werase(popupWin);
delwin(popupWin);
refresh(); //when I do this refresh the contents of the popup window stay, in this case blank spaces because I used werase
}
编辑:根据this using touchwin(stdscr) before refresh 应该可以工作,但它不是 http://linux.die.net/man/3/touchwin