curses库显示函数基本用法样例

来源:互联网 发布:do not tag 淘宝网 编辑:程序博客网 时间:2024/06/03 14:18
/* curses test * file name: cursestest.c * cmd: gcc cursestest.c -lcurses * author: yilonglucky#gmail.com */#include <stdio.h>#include <curses.h>int main(){    initscr();        /* bold */    move(10, 20);    attron(A_BOLD);    addstr("Hello, ");        refresh();    sleep(1);        /* bold + underline */    attron(A_UNDERLINE);    addstr("world!");        refresh();    sleep(1);        /* underline */    move(11, 20);    attroff(A_BOLD);    addstr("Hello, ");        refresh();    sleep(1);        /* normal */    attroff(A_UNDERLINE);    addstr("world!");        refresh();    sleep(1);        /* highlight */    move(12, 20);    standout();    addstr("Hello, world!");    standend();        refresh();    sleep(1);        sleep(10);    endwin();    return 0;}

0 0
原创粉丝点击