Source Code File 13-02_newpad2
13-02_newpad2.c
#include <ncurses.h>
int main()
{
WINDOW *p;
int x;
initscr();
/* create a new pad */
p = newpad(50,100);
if( p==NULL )
{
endwin();
puts("Unable to create pad");
return 1;
}
/* fill the pad */
for(x=0;x<500;x++)
wprintw(p,"%4d",x);
addstr("Press Enter to update");
refresh();
getch();
prefresh(p,0,0,5,5,16,45);
getch();
endwin();
return 0;
}
Output Screenshot

Notes
* Though the pad is wider than the standard screen (per the screenshot above), only the chunk specified by the prefresh() at Line 27 appears on the standard screen.
Copyright © 1997-2025 by QPBC.
All rights reserved
