1

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?

Gabriel Ilharco
  • 1,649
  • 1
  • 21
  • 34
mathsicist
  • 181
  • 4
  • 15
  • Post a complete actual program that shows the problem. – William McBrine Mar 30 '15 at 13:34
  • Also, in general, if you want to have overlapping windows in curses, you should use the panel library. – William McBrine Mar 30 '15 at 13:35
  • @WilliamMcBrine: I've heard about panel library, but I thought that using it don't solve the problem but only "avoid" it. There is my program. Comments are in polish languages, sorry for that. http://pastebin.com/CMqkGQFc – mathsicist Mar 31 '15 at 11:41

1 Answers1

1

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:

Community
  • 1
  • 1
Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105