Keep ncurses window on foreground
My application is using ncurses and has several windows that are continuously being updated.
In that application I have one window acting as a 'message box' (e.g. dialog) showing up when the user hits 'q', asking them if they want to shutdown. This works fine until the other windows are updated. At that point the other windows will be drawn over the dialog box making it (partly) invisible.
Calling wrefresh() on the dialog'开发者_StackOverflow中文版s window doesn't seem to help. How do I force the window to be on the foreground?
I had been reading manual pages all day, couldn't find anything. And of course, 5 minutes after asking my question I found the solution:
redrawwin(dialog_window);
wrefresh(dialog_window);
My dialog now stays on the foreground.
精彩评论