home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / linux / 23011 < prev    next >
Encoding:
Text File  |  1993-01-07  |  1.7 KB  |  66 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!ppcnet!ppcger!sepp
  3. From: sepp@ppcger.ppc.sub.org (Josef Wolf)
  4. Subject: Problems with curses-library
  5. Organization: PPC Cooperation
  6. Date: Wed, 6 Jan 1993 22:30:04 GMT
  7. Message-ID: <C0GEI5.JBE@ppcger.ppc.sub.org>
  8. Lines: 56
  9.  
  10. Hello Folks!
  11.  
  12. I have got some problems with curseperl. I create one window and set
  13. scrollok to 1 on that window. Every time when it comes to scroll, the
  14. y-position of the cursor will be set to -1.
  15.  
  16. To me, this seems to be a (porting?)-bug in the curses-library, because
  17. things behave normally when I change the lines
  18.  
  19.      if (x >= win->_maxx || y >= win->_maxy)
  20.           return ERR;
  21. to
  22.      if (x-1 >= win->_maxx || y-1 >= win->_maxy)
  23.           return ERR;
  24.  
  25. in move.c in the curses-lib.
  26.  
  27. BTW: This is perl 4.035, linux0.99.2, gcc2.3.3, lib4.2(new version).
  28.  
  29. Here is a little test-script which shows this strange behavior on my
  30. machine:
  31.  
  32. --- snipp --- snipp --- snipp --- snipp --- snipp --- snipp --- snipp ---
  33.  
  34. #! /usr/local/bin/curseperl
  35.  
  36. $| = 1;
  37. &initscr; &cbreak; &noecho; &scrollok ($stdscr, 1);
  38. $lines = $LINES; $cols = $COLS;
  39.  
  40. &test_curses;
  41.  
  42. &move ($lines - 1, 0);
  43. &clrtoeol;
  44. &refresh;
  45. &endwin;
  46.  
  47. sub test_curses {
  48.     $w_main = &subwin ($stdscr, 8, $cols, 1, 0);
  49.     $w_debug = &subwin ($stdscr, 2, $cols, $lines - 7, 0);
  50.     &scrollok ($w_main, 1);
  51.     &refresh;
  52. CHAR:    while (($inchr = &getch) ne "q") {
  53.         &wrefresh ($curscr), next CHAR if $inchr eq 'L';
  54.         $count++;
  55.         &waddstr ($w_main, "$count\n");
  56. &getyx($w_main, $y, $x);
  57. &wmove ($w_debug, 0, 0);
  58. &waddstr ($w_debug, "Y$y X$x ");
  59.         &refresh;
  60.     }
  61. }
  62. -- 
  63. sepp@ppcger.ppc.sub.org
  64. Josef Wolf, Germersheim, Germany
  65. ..!ira.uka.de!smurf.sub.org!ppcger.ppc.sub.org
  66.