Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!infovax!bl From: bl@infovax.UUCP (Bj|rn Larsson) Newsgroups: comp.sys.ibm.pc Subject: Re: pccurses v1.3 mvwin() problem Message-ID: <306@infovax.UUCP> Date: 11 Nov 89 21:44:20 GMT References: <16679@dartvax.Dartmouth.EDU> Reply-To: bl@infovax.UUCP (Bj|rn Larsson) Organization: Infovox AB, SOLNA, Sweden Lines: 75 In article <16679@dartvax.Dartmouth.EDU> pete@othello.dartmouth.edu (Pete Schmitt) writes: >The following code works correctly on BSD. It rotates three small windows >that everlap each other. But under pccurses (compiled with Turbo-C 1.5) >the three small windows don't move from the upper left corner of the screen. >Does anyone have this working? > (program example deleted) It should be made clear that PCcurses is a port of Pavel Curtis' PD curses package by the name of 'ncurses'. In the documentation about Ken Arnold's original curses, it says about overlay(win1, win2): 'Overlay win1 on win2. The contents of win1, insofar as they fit, are placed on win2 at their starting (x,y) coordinates...' However, the ncurses documentation says on the same topic: 'These functions overlay win1 on top of win2, that is, all text in win1 is copied to win2, after lining up the two window's origins...' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ I think this verifies the pccurses does the 'right' thing considering its heritage. On the other hand, this way of working appears rather useless to me... and should be easy to fix. Interestingly, I test compiled the submitted programming example on our Ultrix (~BSD) machine, and the windows were placed as the author intended, but they were not displayed in full - only the left and upper borders were visible. Below is a modified version of the example, which works with pccurses. It produces the desired display without using overlay(), but requires 3 WIN structs, plus the storage to hold the lines of the new windows. It's not a solution, but an alternative. And BTW, it works on Ultrix curses... ================================================================ #include main() { WINDOW *win1; WINDOW *win2; WINDOW *win3; int i; initscr(); box(stdscr,'*','-'); refresh(); sleep(2); win1 = newwin(10, 20, 3, 3); win2 = newwin(10, 20, 5, 7); win3 = newwin(10, 20, 7, 11); for(i=1;i<10;i++) box(win1,'*','*'); box(win2,'.','.'); box(win3,'+','+'); while(1) { touchwin(win1); wrefresh(win1); sleep(1); touchwin(win2); wrefresh(win2); sleep(1); touchwin(win3); wrefresh(win3); sleep(1); } endwin(); } ================================================================ -- ====================== InfoVox = Speech Technology ======================= Bjorn Larsson, INFOVOX AB : ...seismo!mcvax!kth!sunic!infovax!bl Box 2503 : bl@infovox.se S-171 02 Solna, Sweden : Phone (+46) 8 735 80 90