mathsicist
mathsicist

Reputation: 191

overlapping windows in pdcurses/ncurses

I need help with my first program, which is using an additional library: pdcurses (ncurses). I created the pop-up window and it works. The problem is when I try to delete this window. As you might guess, though I deleted it, the blank spaces are still there. At first I thought that it wasn't a big deal, I could just recreate the background (another window) again. Nothing could be further from the truth. When I'm recreating the windows using create_rightwin(col, row);, create_leftwin(col, row); again, it breaks this part of these windows, which haven't any contact with the pop-up window. It looks like attron is on, and all titles in other windows are reserved. I've read in the internet that I should use wintouch(), but I don't have any idea how and when to do it. Did anyone have any similar problem?

Upvotes: 1

Views: 3116

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54505

As noted, the panel library solves problems of painting and updating overlapping windows. Both pdcurses and ncurses provide a panel library.

The ncurses programming how-to has a section on the panel library (which includes an example):

The how-to originally came with a zip-file with the sources, which seems to have been mislaid. There is a copy of that linked in the ncurses FAQ in a section listing the how-to along with some other reference material.

The ncurses sources include several test-programs (not as simple as the how-to); a few of these demonstrate the use of panel. Those test-programs are separately available as ncurses-examples.

The panel library is also supported in a few bindings from other languages than C, as discussed in these pages:

Upvotes: 1

Related Questions