Examples:
prints “hello Hussein”
in the middle of the window at position: line 10, column 20.
#include <curses.h>
main()
{
initscr();
clear();
move(10,20);
addstr("Hello Hussein");
refresh();
endwin();
}
prints
“hello Hussein” in the middle of the
window and move it across the line from position:
line 10, column 0 to column 30.
main()
{
int i;
initscr();
clear();
for (i=0; i<30;i++){
move(10,i);
addstr("Hello Hussein");
refresh();
usleep(100000); /* sleep 100 milli
sconds */
move(10,i);
addstr(" ");
}
getch();
endwin();
}
prints
“hello Hussein” in the middle of the
window and move it across the line from position: line 10,
column 0 to column 30. If the user type
“z”, it move to
next line.
main()
{
int i;
int row;
char ch;
initscr();
clear();
nodelay(stdscr,
TRUE); /* non block getch()*/
row=10;
noecho(); /* stop echo of input */
for (i=0; i<30;i++){
move(row,i);
addstr("Hello Hussein");
refresh();
usleep(100000);
move(row,i);
addstr("
");
ch=getch();
if (ch == 'z') {
row++;
i=0;
}
}
getch();
endwin();
}