我创建了一个弹出窗口,它重叠在其他窗口之上,我对其进行了修改,然后将其删除。但是,当我这样做时,背景窗口保留了空白的空间。
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
}
编辑: 根据http://linux.die.net/man/3/touchwin所述,在刷新之前使用touchwin(stdscr)应该可以解决问题,但实际上没用。