home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4613 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.5 KB  |  54 lines

  1. Path: sparky!uunet!dtix!darwin.sura.net!convex!news.utdallas.edu!ggraham
  2. From: ggraham@utdallas.edu (Gregory S. Graham)
  3. Newsgroups: comp.unix.programmer
  4. Subject: Curses help
  5. Summary: I need to know how to make the cursor invisible.
  6. Keywords: curses, cursor, curs_set, leaveok
  7. Message-ID: <1992Sep10.151148.6612@utdallas.edu>
  8. Date: 10 Sep 92 15:11:48 GMT
  9. Sender: usenet@utdallas.edu
  10. Distribution: usa
  11. Organization: Univ. of Texas at Dallas
  12. Lines: 39
  13. Nntp-Posting-Host: csclass.utdallas.edu
  14.  
  15. I have been unable to get curses to cause the cursor to not appear on the
  16. screen.  I have tried the curs_set and leaveok calls, both of which the man
  17. page says can turn off the cursor.  I get ERR returned from curs_set and
  18. leaveok does not turn off the cursor.
  19.  
  20. I am using a Silicon Graphics 340VGX with IRIX 4.0.1.  I am using a VT220
  21. terminal or a PC running NCSA telnet with the TERM environment variable
  22. set to vt100.  I have the same problem using the SGI console window with
  23. TERM=iris-ansi.  I have also tried this on a Sun 4 running Sun OS 4.1.1 with
  24. the NCSA telnet PC for a terminal and the results were the same.
  25.  
  26. I would appreciate any help.
  27.  
  28. Code example follows:
  29.  
  30. #include <curses.h>
  31. main()
  32. {
  33.     char c;
  34.     int i;
  35.  
  36.     /* setup curses */
  37.     initscr();
  38.     cbreak();
  39.     noecho();
  40.  
  41.     /* two attempts to turn off the cursor */
  42.     leaveok(stdscr, TRUE);
  43.     i = curs_set(0);
  44.  
  45.     /* test message */
  46.     mvaddstr(3, 4, "");
  47.     mvprintw(4, 4, "Cursor Test, curs_set returns %d", i);
  48.     refresh();
  49.  
  50.     /* wait for a keypress so that screen can be observed */
  51.     c = getch();
  52.     endwin();
  53. }
  54.