[Top][All Lists]

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

Re: Restarting Curses

From: Nicholas Cole
Subject: Re: Restarting Curses
Date: Thu, 3 Sep 2009 16:02:45 -0400

On Thu, Sep 3, 2009 at 3:55 PM, Tim
Mooney<address@hidden> wrote:
> In regard to: Restarting Curses, Nicholas Cole said (at 3:30pm on Sep 3,
> 2009):
>> Dear Curses List,
>> I have a strange problem.  I have code that can start up and close
>> down curses making sure the terminal is reset.  But if I call it a
>> second time, the terminal is not properly reset.  I'm using python,
>> but I suspect it would be the same in C.  What might I be doing wrong?
> It's been years and years since I've done any curses programming so I'm
> a little rusty, but I do remember this hard-learned lesson: you only want
> to call initscr() ONCE per program.
> I'm sure others can correct me on this, but if you need to "shell out" of
> your curses app for a while, you do want to call endwin().  When you're
> ready to come back to your curses app, I believe just a
> "refresh()/wrefresh()/doupdate()" will do what you need.  I used
> refresh() and that worked perfectly for the curses-based menu system I was
> modifying.
> PS: Looking at the source code for the curses-based app I worked on, it's
> been 14 years since I last did any real curses programming, yet I still
> remember the initscr() lesson.  ;-)

Dear Tim,

I had a nasty feeling that that would be the case, but it makes
certain cases rather inconvenient.  I suppose the library didn't get
its name for nothing!



reply via email to

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