00001 /*@A (C) 1992 Allen I. Holub */ 00002 #include "cur.h" 00003 00004 /*---------------------------------------------------------- 00005 * Scroll the window if scrolling is enabled. Return 1 if we scrolled. (I'm 00006 * not sure if the UNIX function returns 1 on a scroll but it's convenient to 00007 * do it here. Don't assume anything about the return value if you're porting 00008 * to UNIX. Wscroll() is not a curses function. It lets you specify a scroll 00009 * amount and direction (scroll down by -amt if amt is negative); scroll() 00010 * is a macro that evaluates to a wscroll call with an amt of 1. Note that the 00011 * UNIX curses gets very confused when you scroll explicitly (using scroll()). 00012 * In particular, it doesn't clear the bottom line after a scroll but it thinks 00013 * that it has. Therefore, when you try to clear the bottom line, it thinks that 00014 * there's nothing there to clear and ignores your wclrtoeol() commands. Same 00015 * thing happens when you try to print spaces to the bottom line; it thinks 00016 * that spaces are already there and does nothing. You have to fill the bottom 00017 * line with non-space characters of some sort, and then erase it. 00018 */ 00019 00020 int wscroll(WINDOW *win,int amt) 00021 { 00022 if( win->scroll_ok ) 00023 doscroll( win->x_org, win->x_org + (win->x_size-1), 00024 win->y_org, win->y_org + (win->y_size-1), amt, win->attrib ); 00025 00026 return win->scroll_ok ; 00027 }