当前位置: 技术问答>linux和unix
curses画窗口问题
来源: 互联网 发布时间:2016-12-06
本文导语: int main(void) { WINDOW* pwin = NULL; initscr(); raw(); keypad(stdscr,TRUE); int raw,col; getmaxyx(stdscr,raw,col); pwin = newwin(raw/4,col/4,raw/2,col/2); if(pwin == NULL) { return 0; } //box(stdscr,'$','*'); box(pwin,'$','*'); wprintw(pwin,"the first wi...
int main(void)
{
WINDOW* pwin = NULL;
initscr();
raw();
keypad(stdscr,TRUE);
int raw,col;
getmaxyx(stdscr,raw,col);
pwin = newwin(raw/4,col/4,raw/2,col/2);
if(pwin == NULL)
{
return 0;
}
//box(stdscr,'$','*');
box(pwin,'$','*');
wprintw(pwin,"the first window bornn");
refresh();
wrefresh(pwin);
getch();
delwin(pwin);
endwin();
return 0;
}
为什么一定要wprintw和refresh这两个函数才能画出窗口,没有应该也能画出的啊,求高手指点!
{
WINDOW* pwin = NULL;
initscr();
raw();
keypad(stdscr,TRUE);
int raw,col;
getmaxyx(stdscr,raw,col);
pwin = newwin(raw/4,col/4,raw/2,col/2);
if(pwin == NULL)
{
return 0;
}
//box(stdscr,'$','*');
box(pwin,'$','*');
wprintw(pwin,"the first window bornn");
refresh();
wrefresh(pwin);
getch();
delwin(pwin);
endwin();
return 0;
}
为什么一定要wprintw和refresh这两个函数才能画出窗口,没有应该也能画出的啊,求高手指点!
|
refresh 应该是需要的吧,刷新屏幕