bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

delwin() and deleting windows with subwindows


From: Bill Gray
Subject: delwin() and deleting windows with subwindows
Date: Tue, 9 Aug 2022 21:51:52 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

   The man page for this function [1] says

"...Calling delwin deletes the named window, freeing all memory associated with it... Sub-windows must be deleted before the main window can be deleted."

And under "return value", it says that delwin "returns an error value... if the window is the parent of another window."

I wrote a small bit of test code [2] that seems to confirm all this, at least with ncurses-6.2.

The problem is that further down the man page, under "portability", it says :

"Since release 4.0 (1996), ncurses maintains a list of windows for each screen, and is able to recursively delete subwindows when asked to delete their parent. NetBSD copied this feature of ncurses in 2003."

I've implemented the recursive deletion for PDCursesMod. But now I'm wondering if I should have just returned an error code if delwin() is called for a parent window. Easy enough either way, but I don't know which way to go.

Thanks!            -- Bill

[1] https://www.invisible-island.net/ncurses/man/curs_window.3x.html
[2] https://www.projectpluto.com/temp/del_test.c



reply via email to

[Prev in Thread] Current Thread [Next in Thread]