tags:

views:

44

answers:

1

I have a C/ncurses program that I'm debugging/maintaining. This program does ripoffline twice: first, to put a title bar and the second time to put a menu bar on the top of the page.

I need to dropdown some menus so I save the screen before I drop down the menus. In the InitMenu function, I have the following code:

 savewin = newwin (0, 0, 0, 0);
 overwrite (curscr, savewin);
 wrefresh(savewin)

The problem is that savewin is being copied WITH the menu and the ripped off lines, but it gets drawn on the screen BELOW the rippedoff lines. This duplicates the ripped off lines on the screen.

Only realizing where the problem was took me a while. Now, I have no idea how to fix it. Ideally, I would like to copy curscr to savewin without the ripped off lines. Any ideas?

A: 

curscr is the contents of the physical display screen, so it naturally includes the ripped-off lines.

You can instead use stdscr, which will not. You could also try using copywin instead of overwrite - it'll give you more control, including letting you start copying at a different position on the source window.

caf
Using stdscr instead of curscr fixed it. Thank you!
Costi