Xref: utzoo comp.unix.xenix:4182 comp.unix.questions:10704 comp.unix.wizards:13480 Path: utzoo!attcan!uunet!mcvax!hp4nl!targon!andre From: andre@targon.UUCP (andre) Newsgroups: comp.unix.xenix,comp.unix.questions,comp.unix.wizards Subject: Re: Curses Problem Keywords: curses newwin problem Message-ID: <473@targon.UUCP> Date: 14 Dec 88 10:14:48 GMT References: <263@madnix.UUCP> Reply-To: andre@targon.UUCP (Andre van Dalen) Organization: Nixdorf Computer BV., OSP, P.O. Box 29,Vianen, The Netherlands Lines: 55 In article <263@madnix.UUCP> ray@madnix.UUCP (Ray P. Hill) writes: > Why does the following curses code sample produce a different output > on UNIX systems? Because some implementations are not correct, the berkeley curses manual speaks of overwrite at the same x y coordinates, but the terminfo curses manual just speaks of overwriting. On the system I am on, a Pyramid only the row information is used. The 'broken' picture becomes: |------| | | |------| | | | | |------| >/* COMPILE WITH: > * cc -O -o test test.c -lcurses -ltermcap > */ Making the name 'test' was a joke, right? The way I 'solved' the wrong behaviour of the pyramid curses was to make a subwin on the screen I wanted to overwrite with the same dimensions & the same position as the source window. This will work on all curses'es WINDOW *w, *subw; initscr(); w = newwin(10, 10, 5, 5); subw = subwin(stdscr, 10, 10, 5, 5); box(w, 0, 0); overwrite(w, subw); Or, if you know the size and position of all windows in your application you can use a function like: my_overwrite(src, dest, lines, cols, orgy, orgx) WINDOW *src, *dest; int lines, cols, orgy, orgx); { WINDOW *sub = subwin(dest, lines, cols, orgy, orgx); if (sub) { overwrite(src, sub); delwin(sub); } } By the way, beware of overwrite with curscr. Hope this helps, Andre -- ~----~ |m AAA DDDD It's not the kill, but the thrill of the chase. ~|d1|~@-- AA AAvv vvDD DD Segment registers are for worms. ~----~ & AAAAAAAvv vvDD DD ~~~~~~ -- AAA AAAvvvDDDDDD Andre van Dalen, uunet!mcvax!targon!andre