Mail Archives: djgpp/1997/06/20/15:38:52
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.
- Raw text -