Im wondering if anyone can shed some light on the curses window please.
I have made a program that works fine on terminal but I need to make use of the curses window.
I understand the following: initscr(); must be used to initiate the screen, endwin(); to end the curses window, printf to be replaced with printw to print the line in curses, scanf replaced with scanw to obtain user input, mvprintw with column and row identifiers to position the text on the screen.
Kind of understand that refresh(); needs to be implemented, not exactly sure where, and getchar(); gets the enter key press from the keyboard.
If someone could help me out with the curses function, it would be greatly appreciated.
thanks.
The curses library divides the screen up into "windows", or sections of the screen. The default window encapsulates the entire screen (sans anything you use for status lines via the "tear off" functions). You can create additional "windows" which are just subsections of the default window.
The way that curses works is it keeps in memory an array of what should be displayed on the screen. Things like [w]refresh() cause curses to update the actual display with what the memory says it should be. You change the memory array via functions like printw().