[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with overlapping windows
From: |
Jiri Fogl |
Subject: |
Re: Problems with overlapping windows |
Date: |
Mon, 16 Mar 2009 22:33:26 +0100 |
User-agent: |
KMail/1.9.10 |
Hi Stephan, thanks for your reply. I probably gave wrong title to my post - in
fact my solution (see my code snippets) uses panels.
As far as I understood the documentation, a panel is nothing more than kind of
extension to a window. Therefore I have to create a window in its position
first and then I can create a panel assigned to that window.
Exactly this window creation is where I run into the problems - I don't get the
window. newwin() returns not-NULL pointer (that means success according to
documentation), but nothing shows up after using box() or mvwaddstr(). And as I
mentioned before, attempt to manipulate panel assigned to such window i.e.
through show_panel(), hide_panel() or top_panel() ends up in segmentation
fault.
Jiri
Dne po 16. března 2009 Stephan Beal napsal(a):
> 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.
>
> --
> ----- stephan beal
> http://wanderinghorse.net/home/stephan/
>