[Top][All Lists]

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

Re: ncurses applications: best practices

From: Sentinel
Subject: Re: ncurses applications: best practices
Date: Wed, 24 Sep 2008 09:51:57 +0530 (IST)
User-agent: Alpine 1.10 (OSX 962 2008-03-14)

On Tue, 23 Sep 2008, Stephan Beal wrote:

On Tue, Sep 23, 2008 at 5:14 PM, Sentinel <address@hidden> wrote:

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

----- stephan beal

Thanks alot. I was thinking of panels, but not gone into it yet. Your suggestion will probably save me a lot of time. As i see it (I know this is more a programming issue), each file could set up stdscr in its "main" and the rest of the app inside a class (using panels). This way if a file is called directly from the prompt, it can execute the program. If i call it from elsewhere, I instantiate the class (using my existing stdscr) so only new panels are displayed. Sounds good. I will document my learnings as I go and put them up somewhere.
Thanks a lot for all your suggestions. ncurses really rocks!

reply via email to

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