bug-ncurses
[Top][All Lists]
Advanced

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

Trying to preserve original screen


From: Scott Bronson
Subject: Trying to preserve original screen
Date: Mon, 9 Feb 2004 00:57:28 -0800 (PST)
User-agent: SquirrelMail/1.4.1

Hello.  I would like to pop up a 4 line x 80 column status window
at the bottom of the screen during a file transfer, then have the
original screen restored exactly as it was when the transfer is
complete.

I've been trying to do this with ncurses.  The problem is that
ncurses clears the entire screen when refresh is called (thanks
to initscr or newterm).  I need the entire screen to be preserved,
except for the bottom 4 lines.

Is there any way to restrict initscr to the bottom 4 lines of the
screen?  Or, is there a way of getting initscr to preserve the
entire screen, then creating a window to manipulate the bottom 4
lines?

Thank you very much for any hints you might offer.





Restricting the clear to a smaller window doesn't work:

#include <curses.h>

int main()
{
    WINDOW *win;
    WINDOW *w;

    win = initscr();
    keypad(stdscr, TRUE);
    nonl();
    cbreak();
    noecho();

    w = newwin(6, 40, 20, 20);
    wprintw(w, "Hello World");
    wrefresh(w);
    sleep(1);

    endwin();
    return 0;
}



Calling clearok doesn't work:

#include <curses.h>

int main()
{
    WINDOW *win;

    win = initscr();
    keypad(stdscr, TRUE);
    nonl();
    cbreak();
    noecho();

    printw("Hello World");
    clearok(win, 0);
    refresh();
    sleep(1);

    endwin();
    return 0;
}





reply via email to

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