Newsgroups: comp.os.msdos.djgpp From: Pieter Kunst Subject: Re: pdcurses: how scroll in one window? Sender: news AT natlab DOT research DOT philips DOT com (USEnet Subsystem) Message-ID: <33AA884E.9F85ACDA@natlab.research.philips.com> Date: Fri, 20 Jun 1997 13:40:30 GMT Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii References: Mime-Version: 1.0 Organization: Philips Research Labs, Eindhoven, The Netherlands Lines: 37 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Robrecht Jacques wrote: > Hi, > > I'm writing a terminal based program for dos. I am using the pd-curses > library to put all characters nicely on the screen. My screen consists out > of a statusbar (fixed) and the other 24 lines should be scrolling, I mean > that when I do multiple printf's the lines would scroll up when the program > prints after the 25th line. > > If I define windows in pdcurses, I can only use mvaddstr() and such to > print characters, when I use printf() the location is not defined (or I > should also use a move()). I could implement it myself by remembering a the > current-linenumber and scroll everything up when the linenumber is bigger > than 25, but it would take a long time (for me) to get this really > working... So my question is if someone already implemented this or if > there is a way to make the windows scrollable by themself without having to > remember the linenumber yourself? > > --R > > PS I don't need to scroll up again, so everything that disappears on top of > the screen may be forgotten. Two things: (1) Don't mix standard IO (such as "printf") with PDCurses IO. You should do all screen IO using curses functions when working with PDCurses. (2) To enable scrolling, use: scrollok (stdscr, TRUE); (after a call to initscr(); ) Pieter. PS Take a look at the 'tuidemo' sample for basic scrolling.