Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!watmath!idallen From: idallen@watmath.UUCP Newsgroups: net.unix-wizards,net.bugs Subject: Re: CURSES sub-windows bugs - correction to Mike Laman article Message-ID: <8713@watmath.UUCP> Date: Tue, 21-Aug-84 03:38:04 EDT Article-I.D.: watmath.8713 Posted: Tue Aug 21 03:38:04 1984 Date-Received: Tue, 21-Aug-84 07:12:29 EDT References: <8657@watmath.UUCP>, <1137@sdcsvax.UUCP> Organization: U of Waterloo, Ontario Lines: 93 > From: laman@sdcsvax.UUCP (Mike Laman) > First of all let me point out that when sub windows are > created, the window's text is SEPARATE from original window. This is not true with the 4.2bsd curses dated June/July 1983. Sub windows are merely edge vectors into their parent windows. A change in either is reflected in both, since they are the same. > As I mentioned earlier, the real killer is that EACH routine would be > responsible for adding the information to each associated window. > I suggest the correct solution be to have sub windows SHARE the window text > with the information in the WINDOW header telling what part of the lines it > "owns". 4.2 curses already does share window text. The line-change flags are not shared, and are not updated correctly by any of the erase or clearing functions. > As for the problem at hand, I guess you'll have to be happy with > "overwrite()" (and "overlay()"), until you get a System V.2 to use. I would be surprised if even V.2 got sub-windows right. The fix to making clear and erase affect all related window change flags is easy. CLEAR already calls ERASE. Make ERASE and CLRTOBOT call CLRTOEOL for all appropriate lines. Make CLRTOEOL set change flags in all affected windows. Here's a simple sub-windows test program. See if V.2 passes the test. /* Test curses to see if deleting a line in a parent window is * correctly represented in a sub-window. * Test curses to see if clearing part of a sub-window is correctly * represented in the parent window. * idallen@watmath.UUCP Ian! D. Allen University of Waterloo */ #includeWINDOW *win; int bell = 007; int i; main() { initscr(); win = subwin( stdscr, 0, 0, 0, 0 ); for( i=0; i