|
From: | Thomas Dickey |
Subject: | Re: First steps with ncurses |
Date: | Wed, 18 Feb 2009 19:10:14 -0500 (EST) |
On Wed, 18 Feb 2009, TheLonelyStar wrote:
Hi, I did a little test program, to try my ncurses skills :). I wanted to create a little test window. But when I start it, I can not see anything. I don't get it, what is wrong? Thanks! Nathan The source: #include <ncurses.h> int main() { WINDOW* w; initscr(); w = newwin(10,10,10,10); box(w,0,0); wprintw(w,"Hello World"); wrefresh(w); refresh();
this call to refresh is unnecessary - getch does a refresh
getch();
this call to getch refreshes stdscr, which overwrites the change to "w". If you had done wgetch(w); it would work more/less as expected.
endwin(); }
-- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net
[Prev in Thread] | Current Thread | [Next in Thread] |