Reputation: 491
Just started to learn C and got a project using curses. I can't even get the simplest things to draw right now.
Want to do a box and have the following code and it doesn't work. The screens is just black.
What am I doing wrong?
#include <curses.h>
int main()
{
initscr();
noecho();
crmode();
WINDOW * win = newwin(10, 10, 1, 1);
wrefresh(win);
refresh();
getch();
endwin();
}
Upvotes: 3
Views: 19107
Reputation: 27562
Try this.
#include <ncurses.h>
int main(int argc, char *argv[])
{
initscr();
WINDOW *win = newwin(10,10,1,1);
box(win, '*', '*');
touchwin(win);
wrefresh(win);
getchar();
endwin();
return 0;
}
Upvotes: 12