Change the window associated with the panel to the window win.
curses.panel/panel.replace
panel.replace