[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: delwin() and deleting windows with subwindows
From: |
Thomas Dickey |
Subject: |
Re: delwin() and deleting windows with subwindows |
Date: |
Thu, 11 Aug 2022 19:01:19 -0400 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Thu, Aug 11, 2022 at 12:35:49PM -0400, Bill Gray wrote:
> On 8/10/22 20:08, Thomas Dickey wrote:
> > it depends: in the SVr4 code, child-windows have a link to their parent,
> > using that to maintain a reference count -- and tell it if there are no
> > remaining children, and return an error if any remain. But that's not
> > enough to just delete all of the children and the parent window, which
> > would make it nice(r) for applications.
>
> Well, yes... nicer, and apparently we _should_ recursively delete to
> follow the XSI Curses standard ("It [delwin] must delete subwindows before
> deleting their parent.")
It's arguably ambiguous: others read that as saying that delwin can't
touch the parent until the subwindows have been (by whatever means)
deleted.
> The only downside I see to recursive deletion would be if you did the
> following :
>
> WINDOW *win = newwin( ...);
> WINDOW *sub = subwin( win, ...);
>
> delwin( win);
> access something in sub;
>
> At present, the delwin() call would fail in ncurses and SVr4. In
> PDCurses and Solaris X/Open curses, win would be deleted and sub wouldn't.
> In either case, attempts to access something in sub will still work.
portability's a problem :-)
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net
signature.asc
Description: PGP signature
- delwin() and deleting windows with subwindows, Bill Gray, 2022/08/09
- Re: delwin() and deleting windows with subwindows, Thomas Dickey, 2022/08/10
- Re: delwin() and deleting windows with subwindows, Bill Gray, 2022/08/11
- Re: delwin() and deleting windows with subwindows, G. Branden Robinson, 2022/08/11
- Re: delwin() and deleting windows with subwindows, Bill Gray, 2022/08/11
- Re: delwin() and deleting windows with subwindows, Thomas Dickey, 2022/08/13
- Re: delwin() and deleting windows with subwindows, Bill Gray, 2022/08/14
- Re: delwin() and deleting windows with subwindows, Thomas Dickey, 2022/08/14
- Re: delwin() and deleting windows with subwindows,
Thomas Dickey <=