bug-ncurses
[Top][All Lists]
Advanced

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

Re: ncurses applications: best practices


From: Stephan Beal
Subject: Re: ncurses applications: best practices
Date: Tue, 23 Sep 2008 23:43:03 +0200

On Tue, Sep 23, 2008 at 5:14 PM, Sentinel <address@hidden> wrote:
> ONE NEW POINT - MULTI-PAGE APPS:
>
> Have any of you created multi-page apps. Like a menu page which calls
> various screens etc. (Think pine/alpine). Can someone give me a quick
> pointer on doing this. Do i do this within the same curses session, or do an
> endwin for page 1, and then start again for page 2.

The way to do this, IMO, is to quit using WINDOWs for layout and to
use PANELs instead. Create only stdscr, then use panels to manage your
main layout. You can create screen-sized panels and bring each one to
the top as you go to the next page. You could also have a tab bar (or
similar) across the top and catch click events to trigger a certain
panel coming to the top. If you have overlapping windows, DON'T use
the WINDOW class directly - use a PANEL instead. PANELs have
advantages over WINDOWs, mainly in that they handle overlapping
content predictably. Within a given PANEL you would use subwindows to
manage the layout (you cannot have embedded panels, though you can
simulate a similar effect if you use screen-sized panels for pages and
show only the applicable "child" panels when that page comes to the
front).


-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/




reply via email to

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