[Top][All Lists]

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

Re: mvwin, windows and derwins/subwins

From: Thomas Dickey
Subject: Re: mvwin, windows and derwins/subwins
Date: Mon, 6 Feb 2006 15:12:05 -0500 (EST)

On Mon, 6 Feb 2006, Bryan Christ wrote:

Can subwins be derived from subwins? I can't seem to find any concrete documentation on this other than an unsettling comment in the man pages which says "The subwindow functions (subwin, derwin, mvderwin, wsyncup, wsyncdown, wcursyncup, syncok) are flaky, incompletely implemented, and not well tested."

hmm - not that bad, perhaps. (I didn't write that comment; advised against dealing with the matter in that fashion ;-)

however, no one's complained about the _code_ recently (with a testcase, of course), so it might be neglected. Even with a testcase, compatibility with other implementations is something to consider (as noted below, there
are limitations common to all implementations).

In other words, is this hiearchy valid:


If so, what happens to the derwins when the parent window is moved with mvwin? Do the derived/subwins get moved accordingly?

mvwin itself only adjusts its own data (as a quick look at ncurses/base/lib_mvwin.c would demonstrate). Generally speaking, curses doesn't pay much attention to _child_ windows; it looks at _parent_ windows. This is true of more than just ncurses (as I write this, I'm looking at the other implementations which currently show source: pdcurses, netbsd and opensolaris).

The application creates windows and subwindows, and knows about them.
So it has to do the work (or the menu library should, depending on where
you're heading with this).

Since derived windows share storage with the parent window, one might
expect that moving the real window works for derwin's, which are defined relative to the parent. However, the derived window's beginning is computed when the derived window is created. The functions that modify it do not use this information (except for wsyncup and wcursyncup).

Thomas E. Dickey

reply via email to

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