使用护士刷新重叠的窗口

Refresh overlapping windows using ncurses

本文关键字:重叠 窗口 刷新      更新时间:2023-10-16

我创建了一个与其他窗口重叠的弹出窗口,我修改了它,然后删除了它。但是当我这样做的时候,背景窗口保持空白。

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
 }

编辑:根据这个使用touchwin(stdscr)刷新之前应该工作,但它没有http://linux.die.net/man/3/touchwin

我看到了我的问题,当我需要创建一个新窗口时,我正在创建一个子窗口。当我测试主窗口被改变的地方,使用is_wintouch,它只在删除子窗口后返回true,我不知道为什么。

窗口位于窗口原点的中间,因此对一个窗口的更改将影响两个窗口。http://linux.die.net/man/3/subwin