[comp.unix.questions] curses problems

Leisner.Henr@xerox.com (Marty) (02/18/90)

I'm using BSD curses on a sun386i and I have some unexplained weirdness.
(Maybe it was a mistake to use curses?)

I'm driving out menus with code that looks something like this:

	for(i = 10, 	pitem = &items; pitem->option_name; pitem++, i++) {
		move(i, 20);
		printw("%s", pitem->option_name);
	}

	move(LINES - 3, 0);
	printw("Enter option-->>");
	clrtobot();
	refresh();
	getstr(input);


The last option in the loop always prints right the first time.  However,
after the  program executes certain sequences of printw, clear, move and
refresh, the last option printed in the loop isn't in the right place (this
is bizarre).

Spacing over 20 spaces, curses outputs 2 tabs and 4 spaces.

When things break, the last line printed in the loop isn't prefaced by 2
tab/4 spaces, instead it's prefaced by 4 backspaces (I found this using
script).

I'm stumped -- what types of things should I look for?  Do other people
have good experience with curses for doing interactive applications?  Are
there any complicated curses programs I can look at out there?

(Please email me replies since my info-unix connection is flakey).

marty
ARPA:	leisner.henr@xerox.com
GV:  leisner.henr
NS:  leisner:wbst139:xerox
UUCP:	hplabs!arisia!leisner
 

unhd (Roger Gonzalez ) (02/20/90)

Sounds like a magic cookie bug.  But then, I haven't seen a terminal that
left magic cookies since tvi950's.  I also hate curses, though.  I like
raw termcap much better.  Curses is like being bludgeoned in a dark alley.
At least with termcap, you can see what's bludgeoning you.
-rg-

-- 
UUCP:   ..!uunet!unhd!rg      | USPS: Marine Systems Engineering Laboratory
BITNET: r_gonzalez at unhh    |       University of New Hampshire
PHONE:  (603) 862-4600        |       242 SERB
FAX:    (603) 862-4399        |       Durham, NH  03824-3525