#include<ncurses.h>
int main()
{
WINDOW *win ;
initscr();
win = newwin(10,30,10,10);
box( win, ACS_VLINE, ACS_HLINE);
refresh();
wrefresh(win);
mvwprintw(win , 13, 14, "Enter any Key :\n ");
refresh();
wrefresh(win);
getch();
refresh();
wrefresh(win);
endwin();
printf("END");
return 0;
}
I just started learning Ncurses and have some questions:
i understand that initscr()
is used for windows parameters initialization.
the first thing which is worrying me is:
win = newwin(10,10,10,10);
this is creating me a window some where near middle of the the monitor.
---> my problem is :
how to choose those values n_lines , n_cols, y and x.
i assume that n_lines indicates the no of characters that can be seen on the screen at a time in line by line fashion.
i assume that n_cols indicates the no of characters that can be seen on the screen at a time ( one by the side of another ).
then y and x i dont understand from where it starts :
this is with respect to creating a window and a box .
the second problem is mvwprintw(win , 13, 14, "Enter any Key :\n ");
this statement is not getting printed on the screen.
and the program is getting many refresh and wrefresh statements.
is there any way to reduce them .
Your opinion , answers , guidelines are greatly appreciated.
thanks