home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!smurf.sub.org!ppcnet!ppcger!sepp
- From: sepp@ppcger.ppc.sub.org (Josef Wolf)
- Subject: Problems with curses-library
- Organization: PPC Cooperation
- Date: Wed, 6 Jan 1993 22:30:04 GMT
- Message-ID: <C0GEI5.JBE@ppcger.ppc.sub.org>
- Lines: 56
-
- Hello Folks!
-
- I have got some problems with curseperl. I create one window and set
- scrollok to 1 on that window. Every time when it comes to scroll, the
- y-position of the cursor will be set to -1.
-
- To me, this seems to be a (porting?)-bug in the curses-library, because
- things behave normally when I change the lines
-
- if (x >= win->_maxx || y >= win->_maxy)
- return ERR;
- to
- if (x-1 >= win->_maxx || y-1 >= win->_maxy)
- return ERR;
-
- in move.c in the curses-lib.
-
- BTW: This is perl 4.035, linux0.99.2, gcc2.3.3, lib4.2(new version).
-
- Here is a little test-script which shows this strange behavior on my
- machine:
-
- --- snipp --- snipp --- snipp --- snipp --- snipp --- snipp --- snipp ---
-
- #! /usr/local/bin/curseperl
-
- $| = 1;
- &initscr; &cbreak; &noecho; &scrollok ($stdscr, 1);
- $lines = $LINES; $cols = $COLS;
-
- &test_curses;
-
- &move ($lines - 1, 0);
- &clrtoeol;
- &refresh;
- &endwin;
-
- sub test_curses {
- $w_main = &subwin ($stdscr, 8, $cols, 1, 0);
- $w_debug = &subwin ($stdscr, 2, $cols, $lines - 7, 0);
- &scrollok ($w_main, 1);
- &refresh;
- CHAR: while (($inchr = &getch) ne "q") {
- &wrefresh ($curscr), next CHAR if $inchr eq 'L';
- $count++;
- &waddstr ($w_main, "$count\n");
- &getyx($w_main, $y, $x);
- &wmove ($w_debug, 0, 0);
- &waddstr ($w_debug, "Y$y X$x ");
- &refresh;
- }
- }
- --
- sepp@ppcger.ppc.sub.org
- Josef Wolf, Germersheim, Germany
- ..!ira.uka.de!smurf.sub.org!ppcger.ppc.sub.org
-