bug-ncurses
[Top][All Lists]
Advanced

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

Re: Problems with overlapping windows


From: Thomas Dickey
Subject: Re: Problems with overlapping windows
Date: Mon, 16 Mar 2009 17:20:12 -0400 (EDT)

On Mon, 16 Mar 2009, Stephan Beal wrote:

On Mon, Mar 16, 2009 at 6:18 PM, Jiri Fogl <address@hidden> wrote:
Hi, I'd like to ask if there are some circumstances I should be aware of when
creating overlapping windows.

Overlapping windows are fundamentally problematic (and painful) in
curses. Use the PANEL interface instead, as those can be stacked,
moved, etc. In my experience, the easiest way to set up the screen
when using overlapping stuff:

a) Create a PANEL with the same size as stdscr. i use this as my "root window".
b) any "smaller" windows get stacked somewhere above that root. To
hide a window i can either use the PANEL's hide API or move it to the
bottom of the stack (under the root panel).

Note that panels cannot be embedded within each other - a panel is a
top-level component with an associated WINDOW (of the same size as the
panel) on which it draws. The panel can be subdivided into smaller
areas by creating (non-overlapping) subwindows of the panel's main
window element.

It takes some practice, but it's MUCH less painful than working with
overlapping windows.

The only drawback is that _portable_ curses applications can't rely on
panel being available, since it's an add-on (not present in HPUX or AIX
curses).

ncurses has it, of course - so you should use panels...

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

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