Problem with Curses, AIX 3., RS/6000
Peter Mroz
mroz at eplrx7.uucp
Wed Aug 22 05:29:01 AEST 1990
Hello netters,
I'm having a weird problem with curses on an IBM 530 RS/6000 running
golden code. I've tried to reduce the problem to its essentials in the
small test program included below. Basically, the program works when I
include curses.h and link to -lcur. However, one is supposed to use -lcurses
with curses.h. This is what I'd prefer to do, as -lcurses includes such
niceties as box, wattron, and wattroff. The problem I have when I link to
-lcurses is that stuff written to the right edge of the screen gets shifted
over to the left by one character. Here's sample output from the program that
works:
$ testc
+ +
12345
+ +
This program writes the top line OK, but the rest of the stuff is shifted
over to the left by one character:
$ testc1
+ +
12345
+ +
Thanks for any help.
------------------------------------------------------------------------
/* testc.c */
#include <stdio.h>
#include <curses.h>
main ()
{
WINDOW *testwin;
char *numbers = "12345";
initscr();
testwin = newwin(5, 5, 0, 75);
mvwaddch(testwin, 0, 0, '+');
mvwaddch(testwin, 0, 4, '+');
mvwaddch(testwin, 4, 0, '+');
mvwaddch(testwin, 4, 4, '+');
mvwaddstr(testwin, 2, 0, numbers);
wrefresh(testwin);
sleep(5);
endwin();
exit(0);
}
------------------------------------------------------------------------
# Makefile for testc and testc1
CFLAGS= -g
all: testc testc1
testc: testc.o
cc $(CFLAGS) testc.o -o testc -lcur
testc1: testc.o
cc $(CFLAGS) testc.o -o testc1 -lcurses
--
Peter Mroz | E.I. Du Pont de Nemours & Co.
eplrx7!mroz at uunet.uu.net | Consultant, Scicon
mrozpa%wmvx at dupont.com | DuPont Building, D4078
| Wilmington, DE 19898
--
The UUCP Mailer
More information about the Comp.unix.aix
mailing list