bug-ncurses
[Top][All Lists]
Advanced

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

window fails to display after wrefresh()


From: Joshua Karstendick
Subject: window fails to display after wrefresh()
Date: Wed, 22 Jun 2005 15:18:28 -0400

In the following program, I try to demonstrate the use of windows by creating two windows next to each other. win1 is supposed to be displayed, then win2.

But if I don't call refresh(), win1 is never displayed. Oddly enough, win2 is, though. I'm calling wrefresh() on both of them.

I'm using version 5.4 of Ncurses. Here's the code:

#include <ncurses.h>


int main(void)
{
    WINDOW *win1, *win2;
    int rows, cols;
   
   
    initscr();
    cbreak();
    noecho();
   
    getmaxyx(stdscr, rows, cols);
    refresh();
   
    win1 = newwin(rows, cols/2, 0, 0);
    win2 = newwin(rows, cols/2, 0, cols/2);
   
    box(win1, 0, 0);
    box(win2, 0, 0);

    mvwprintw(win1,1, 1, "This is win1.");
    mvwprintw(win1, 2, 1, "Hit any key to see win2.");

    mvwprintw(win2, 1, 1, "This is win2.");
   
    wrefresh(win1);
    getch();
    wrefresh(win2);
    getch();
   
    delwin(win1);
    delwin(win2);
    endwin();
   
    return 0;
}


--
Joshua Karstendick

reply via email to

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