A different curses question

Jeffrey Youngstrom jeffy at teda.UUCP
Tue Jan 16 10:26:02 AEST 1990


On my Sun 3/80 SunOS 4.0.3 in case it matters, I'm having
trouble with the overlay() function.  Namely it seems to
do the same thing as overwrite()  (replaces the contents
of it's second arg by the contents of its first.)

Here's some code:


#include <curses.h>

main()
{
    WINDOW *win1, *win2;
    char c;

    initscr();
    crmode();
    win1=newwin(LINES, COLS, 0, 0);
    win2=newwin(LINES, COLS, 0, 0);
    wmove(win1, 10, 10) ; waddstr(win1, "this is window number one");
    wmove(win2, 20, 20) ; waddstr(win2, "this is window number two");

    wrefresh(win1);        /* show win one  */

    c=getchar();clear();refresh();
    wrefresh(win2);        /* show win two  */

    c=getchar();clear();refresh();
    overlay(win1, win2);   /* overlay */
    wrefresh(win2);        /* unfortunately, when it shows win2 here,
                              it looks just like win1 did before :-( */

    c=getchar();clear();refresh();
    endwin();

    return;
}

TFM wasn't helpful.
I would appreciate any emailed suggestions!
AtDhVaAnNkCsE!!!

jeffy
Curses...foiled again!
-- 
        ...!{decwrl,sun}!teraida!jeffy or jeffy at altair.csustan.edu
Read it in the books in the crannies and the nooks there are books to read



More information about the Comp.lang.c mailing list