//初始化
initscr()
//獲得屏幕尺寸
getmaxyx(stdscr, h, w)
//畫背景
for(i=0 i<h i++)
for(j=0 j<w j++){
mvaddch(i, j, ACS_CKBOARD)
}
refresh()
//建立窗口
Pad = newPad(80, 128)
for(i=0 i<80 i++){
char line[128]
sprintf(line, "This line in Pad is numbered d\n", i)
mvwprintw(Pad, i, 0, line)
}
//刷新屏幕
refresh()
prefresh(Pad, 0, 1, 5, 10, 20, 45)
for(i=0 i<50 i++){
prefresh(Pad, i+1, 1, 5, 10, 20, 45)
usleep(30000)
}
//等待按鍵
getch()
標簽:
getmaxyx
initscr
stdscr
for
上傳時間:
2014-08-30
上傳用戶:龍飛艇