Nofew

CursesThing

May 23rd, 2016
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include <curses.h>
  2.  
  3. int main(void) {
  4.     int KeyPressed;
  5.     system("mode 100, 50");
  6.     initscr(); // Here we go!
  7.     raw();
  8.     nonl();
  9.     noecho();
  10.     keypad(stdscr, TRUE);
  11.     curs_set(2);
  12.     WINDOW *Wind;
  13.  
  14.     // This works fine.
  15.     Wind=newwin(3, 10, 4, 4);
  16.     box(Wind, 0, 0);
  17.     wnoutrefresh(Wind);
  18.     wrefresh(Wind);
  19.     doupdate();
  20.  
  21.     // This also works.
  22.     KeyPressed = getch();
  23.     move(5, 12);
  24.     wnoutrefresh(Wind);
  25.     wrefresh(Wind);
  26.     doupdate();
  27.  
  28.     // This does not appear to move the cursor.
  29.     KeyPressed = getch();
  30.     wmove(Wind, 1, 1);
  31.     wnoutrefresh(Wind);
  32.     wrefresh(Wind);
  33.     doupdate();
  34.  
  35.     KeyPressed = getch();
  36.     endwin();
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment