help needed with curses screen control package
taylor at sdccsu3.UUCP
taylor at sdccsu3.UUCP
Mon Aug 20 00:24:51 AEST 1984
I am having some problems getting the curses screen control
package to do what I want...and hope someone can offer some help.
What I want to do is to have the help routine in my program
create its own window, write the help screen to this window, and then
when the user is done reading it remove the window to reveal the original
screen that was 'underneath' (so to speak).
Using the overwrite (win1, win2) doesn't seem to do the trick!
Enclosed is a sample program that will give you an idea of what
I am trying to do....if anyone can get this working correctly I would be
most appreciative, as I have been trying all permutations and none have
succeeded.
Thanks vastly!
Dave Taylor
We have UNIX 4.2 bsd
-----------
test.c
-----------
#include <curses.h>
main()
{
initscr();
addstr(Hi there");
refresh();
delay();
new_window();
delay();
}
new_window()
{
/** this routine should overlay on TOP of the other, restoring the other
when it leaves **/
WINDOW *test;
test = newwin(0,0,0,0);
overwrite(test,stdscr); /** make the screen look like 'test' **/
waddstr(test, "testing...!");
wrefresh(test);
delay();
overwrite(stdscr,test); /** return to old screen !!!! **/
refresh();
}
delay()
{
int i;
for (i=0;i< 100000 ; i++) ;
/** wonderful routine, eh? **/
}
--------
end of test.c
--------
More information about the Comp.unix.wizards
mailing list