curses endwin

curses endwin

Post by jake3 » Fri, 22 Aug 2003 16:23:11

From the man page:
``A program should always call endwin before exiting or escaping
from curses mode temporarily.''

So there is no need to call any other function that would destroy data
structures associated with the current settings of the current pointer
to WINDOW type? How can curses tell whether or not someone calls
endwin to restore changes temporarily or is wanting to exit(so it
should then destroy the WINDOW * data structure). The thing here, is
the pointer to the WINDOW type makes me think it is pointing to
allocated storage to hold the current settings for the window.. so it
_must_ free them somehow. I was looking at delscreen() but that seems
to be _only_ for SCREEN * types not WINDOW * types. So I am a bit
confused on whether or not just calling endwin before exiting is

curses endwin

Post by Thomas Dic » Tue, 26 Aug 2003 07:23:23

It can't. Read the rest of the manpage. For instance (man endwin):

A program should always call endwin() before exiting or
escaping from curses mode temporarily. This routine restores
tty modes, moves the cursor to the lower left-hand corner of
the screen and resets the terminal into the proper non-
visual mode. Calling refresh() or doupdate() after a tem-
porary escape causes the program to resume visual mode.

The isendwin() routine returns TRUE if endwin() has been
called without any subsequent calls to wrefresh(), and FALSE

Thomas E. *** ey < XXXX@XXXXX.COM > < XXXX@XXXXX.COM >